Everyone who has ever played D&D can answer that in one line, which is:
Wizards are weak as shit.
Have you ever played a D&D wizard and got into a battle scene? Wizards can't fight worth crap. They require having one of your fighters pulled out of the battle just to stand there and protect the group's weak ass wizards.
In D&D a Wizard can't just wave his wand and POOF shit happens. No. It takes 1 to 5 turns for him to gather herbs, process herbs, write a scroll, chant over the scroll, embed the herbs and scroll in his wand, and then MAYBE if 5 turns later the fight is still going, MAYBE he'll roll a 20 and be able to cast the spell successfully, but even after casting it, it takes 3 MORE turns before the spell takes affect, meaning at MINIMUM you have to wait 5 to 8 turns before your group's wizard gets his shit together and casts the spell... most battles are over 3 to 4 turns into the battle, so most wizards never get a chance to cast a spell at all.
THEN... if the wizard did cast the spell successfully, you have to have a healer on hand, because now the wizard is out of commision for 3 to 5 more turns because the spell drains his health down to 10, meaning one hit from the enemy and he's dead. After the battle the group can't just move onto the next quest, they have to wait for their wizard to rest for a week or more to regain his health, because wizards regain their health slower then any other class, in addition to their health going down faster per hit then any other class. The rest can be down to only 2 days if your group got lucky and the wizard is an Elf so heals faster.
And people wonder why so many DM's homebrew the wizards in their games. It's because wizards straight from the rules book are weaklings who are liabilities in battle.
The wizard class in D&D was not intended to be used as fighters in battle, instead they are intended to be the character who reads the books, solves the riddles, and communicates with other races. They are educated scholars who can speak vast amounts of languages. They make the weapons for the fighters. They make holy relics for the priests. They are craftsmen. Remember the fighters in D&D are supposed to be illiterate barbarians with no ability to read and write, no diplomacy skills, no languages, and no crafting skills. They are there to fight. In a D&D group the wizard is the diplomat, the translator, the scholar, chef, herbalist, and the one who makes the magical weapons the fighters uses. The wizards make the magic items and scrolls used by the healers. The wizards gather the herbs for the druids and alchemists. In D&D wizards are not designed for nor intended to be used in battle. You have to homebrew double class if you want to use a Wizard in battle in a D&D game.
Part of the reason I like how D&D handles wizards, over the way other media uses wizards, is because while D&D wizards can cast super insane over powered spells, the spells don't just happen at the flick of a wand. They require time to prep. The wizard has to head out into the field and gather herbs. He has to scour through libraries in search of old chants to learn. He doesn't just know this stuff, he really has to work for it. Then in battle he can't just run out there wands blazing, he has to hide in the back with a fighter protecting him, while he preps stuff, he maybe has too risk his life to run out into the battlefront to pick some danged flower essential to the spell, and then he doesn't just cast the spell without consequences. It takes a huge toll on his health to cast a single high powered battle spell, and if he's not careful the energy drain alone will kill him, and then he's days before he can even get out of bed let alone try to cast a second spell.
I like how the D&D rules let wizards have insane powers, but don't let them just run around like weapons of mass destruction with those powers. It really makes playing a wizard a challenge because you have to constantly be on your toes worrying about how badly the side effects of casting are going to hurt you.
Well...when I write wizards, which is the only thing I write, because I love wizards, I use the D&D core rules for the wizard class as the basis for my wizards in my novels and short stories.
The series I write (which has 130+ novels so far) is about 3 wizards whom, in their world are thought to be the most powerful wizards of all time. Most people are scared shitless of them, thinking of wizards as invincible. Warriors and such come at them with everything they got because the rumours about these guys are wild.
But the reader follows the wizards themselves through their every day life, and so the reader knows first hand, that there is a vast difference between the reality of what these 3 men can do magically and the rumors that exist about wizards. Readers see that while the world fears wizards and is filled with all kinds of rumours that makes wizards out to be invincible battle mages, the reader sees these 3 men who are struggling just to survive. They are driven from their homes, never able to settle down, have to live on the run, are forced to scavenge for food in the forest because no one will welcome a wizard into their home.
Readers see that they are in ill health most of the time and are physically very weak. They suffer from constantly being sick, they long for being able to just stop and rest for a week, without the fear of having to flee yet again. They try to hide the fact that they are wizards from strangers they meet. They know nothing of fighting and battles and wars, and are educated scholars who excel at book learning and have no skills at war. They are simple men, just trying to get from one day to the next. They are not looking for quests or treasure or monsters. They just want to be allowed to have homes and families like everyone else. Things they are denied because the world fears wizards so badly.
Readers see the reality that magic can't solve everything, magic is highly limited, and when faced with a warlord in battle, the world's 3 most powerful wizards turn tail and run, because while the world thinks magic can do everything, they know their magic has limits and they can't win a fight against a warlord using nothing but magic.
Given the time to cast a spell, any one of them can make big things happen, but casting magic in the heat of the moment on the battlefield isn't possible and would cost the wizard his life.
So, for example there was a scene in one story where the wizards spend the night camped out with some bandits they met. And one wizard is cooking super for the rest of them, and one bandit notices he's just cooking "regular" like - not using magic. The bandit asks him about it, "Why don't you just use magic to start the fire?" "Why don't you just make bread appear out of thin air?" "Why aren't you using magic?" And the wizard answers with: "We have a long way to travel tomorrow. I can't afford to spend half the morning in bed resting."
Magic weakens them physically. Almost as though magic was a virus. Like how when you get the flue and you are weak and aching for days and just can't do anything no matter how much you want to. Magic has effects like that. It helps the wizards do things, but at a cost to their health.
So in the scene above, he could have waved his wand and poof fire or food magically appear, but he had to weigh out was the cost worth it? Was having instant food tonight, worth being sick in bed for hours, perhaps days afterwards?
The main character of the series, has been a wizard longer then the others. He himself is the most powerful wizard the world has ever known. And he also has a nickname tacked on to his name to prove it. Once know n as Quaraun the Pink Necromancer, he is now known as Quaraun the Insane. A title he hates, but can not run from. His companion, a wizard nearly as powerful, is likewise dubbed "The Crazed".
Magic is gruelling, not only physically, but also mentally. Casters have to meditate and focus on their intent, for the spell they are casting to work. Small spells, don't take much effort, but many small spells over time wear the mind down, and it only takes a few large spells to see devastating mental side effects. The wizards often take powerful hallucinogenics when casting their spells, with further damages their brains. Some wizards become addicted to the herbs used in casting and become drug addicts as a result. This results in both the older a wizard is and the more powerful he is, the chances are high that he is also seriously mentally compromised and has long ago gone insane. Resulting in very powerful wizards also being very dangerous, because their mental state can no longer be trusted to cast the spells competently.
Because powerful wizards go insane and insane wizards are very dangerous, the government has set up a militant law enforcement group that hunts down and kills wizards before they get too powerful. Thus why the 3 main characters of the series are on the run and have banded together.
One of the 3 wizards, devolpes parinoid schizophrenia as a side effects of too many years using magic. His ability to continue casting magic is hampered by his roaving fear of a flock of pink flying goldfish hiding in the clouds waiting to eat him if he uses magic.
The main character is an elderly 750 year old Elf. Elves are a race that should live in near perfect health, almost never getting sick, with little to no aging. Yet he suffers a weak heart, cataleptic seizures, arthritis like joint pains, walks with a cane from a lame leg, passes out/faints multiple times a day, gets flues/colds multiple times a year, has no muscle strength from muscles thinning and growing weak, and has visible signs of aging (wrinkles and growing thin). Things no pure blooded Elf should suffer, plague him as side effects to his long term use of magic.
In the end, you see that while wizards in this world have the potential to become insanely overpowered battle weapons that could potentially wipe out the planet, you also see that this doesn't happen because there are so many side effects to using magic which hinder how much wizards actually can do, in spite of what they potentially could do. Thus, while they are very over powered, they are also limited by side effects that prevent them from actually acting on their powers often, if ever.
So that's how I handle keeping wizards from being over powered.