The other answers here are good, but they miss the fact that a wizard's spells known can decrease, as well as increase. Many GMs delight in stealing, burning, temporarily confiscating or damaging player character spellbooks, and I've known more than one wizard who sold off a few spellbook pages in order to make rent. All of those things can happen to NPC wizards, too. An NPC wizard could plausibly have any number of spells from zero and up.
As for how many spells an NPC wizard of a given level should know, my advice is to throw away formulae and ask one simple question: How many spells would the wizard want to know?
Generally, a wizard wants spells that fulfill specific purposes:
- Self defense
- Making day-to-day life easier
- Earning money
- Entertaining the mage and any guests he might have
- Making the caster appear awesome
- Not having any other use for spell slots of the spell's level
On the other hand, learning spells costs money, and money can be spent on other things that a wizard might want:
- Crafting magic items
- A comfortable tower by a lake
- A small force of kobolds to guard the upper levels of the dungeon
- Next month's protection money
- Other, more useful spells
What I'm getting at is that wizards have a strong motivation to only learn spells that they actually benefit from. Sure, a conjurer could learn teleport, but if he already knows teleport without error he could save the money.
So, to choose how many spells a wizard should have, start with the ones that they would want. In my experience there's plenty of these. When you run out - or when the new spells overlap with the earlier ones to the point where they don't actually provide the mage with much benefit - stop, and spend the rest of the caster's cash on other things.
EDIT: For some reason I assumed that this question was about creating NPCs wizards, but as has been pointed out to me, it could just as easily be a PC. If you are looking for a guideline as to what spells a PC wizard can know, things get a little trickier.
Artificially limiting the number of spells a wizard player character can know, given that being able to learn an unlimited number of spells is one of the most interesting and unique features of the wizard class, is a little questionable. Fortunately, most players won't try this more than once: Spells cost money, and since a PC can generally only prepare a small number of spells each day, chances are only a few of the spells a PC knows will see regular use; The rest will sit unused in the PC's spellbooks until they get bookworm. As soon as a PC realises that money spent on spells they don't use is money wasted, expect to see some significant cutbacks.
To summarize, whether it's a PC or an NPC, learning every spell isn't as useful as it sounds - So if it's an NPC, have them ignore the spells they wouldn't be interested in, and if it's a PC, point out that they're unlikely to use every spell they start with, and they can always buy extra spells later, when the need arises.