That's a wizard level 17 or higher. Straight wizard, doesn't matter the subclass. Wizards have the largest list of spells and a wizard can conceivably know all of them. (I am not counting Theurgy Wizard there, as that was a UA that didn't make a main book and so is not any different to me than any homebrew for the purpose of this question. But, sure, since you can get cleric spells at level up instead of wizard spells, that would get you as many as 19 additional spells beyond what a wizard can get. This only applies to the idea of knowing more spells, not for the other possibilities of what you mean.)

Now, if you mean how do you cast the most spells in a given day, regardless of what the spells are, that is simply any caster of any sort at any level, due to cantrips.

If you mean how do you get the most total spell levels, then we're back to a wizard of level 18 or higher. Being able to cast a 2nd level spell at will overwhelms any other addition of spells that I know of.

If you are asking for the most number of actual spell slots, then I think we're back to a single-class wizard. Multiclassing costs spell slots. If I read things correctly, if you are a 10th-level wizard and decide to pick up a different class (even a full caster), you immediately lose 4 spell slots rather than gain any. Any dip out of straight full caster means a loss of spell slots over all. Pact magic slots from a warlock do not make up for the loss, in power or number.