Its not necessarily one component but several. I have thought of this lately as well. Things that I have considered.
Trench warfare occurred when a revolution in firepower was not matched by similar advances in mobility, resulting in a grueling form of warfare in which the defender held the advantage. In World War I, both sides constructed elaborate trench and dugout systems opposing each other along a front, protected from assault by barbed wire.
First the basic Soldier Crossbows are a must. Perhaps repeating crossbows. Knights are pretty much done for as the whole reason trench warfare started is due to lack of mobility. With all the craters and hazards in no mans land it would be extremely difficult to maintain cohesion for an effective cavalry charge.
Artillery The main killer. You have the right idea. 523
Trebuchets, catapults, Batista and lots and lots of them. They can lob boulders, flaming pots with nails, perhaps some sort of alchemist gasses, greek fire, etc...
Machine Guns Your "machine guns" could be The Scorpio-Ballista (see roman) where they fired serial bolts.
Airplanes The dragons could be airplanes but seem a bit overpowered, perhaps Pegasus archers (think mongols but on Pegasus.)
It seems like you have most of this down and I only point this out to show that you can have conditions much like WW1 WITHOUT the need for mages.
Now onto your question. To answer this question more fully I would need a better idea of what your magic system entails. Is this D&D magic system?
If you insist on having mages then IMO any power level could be appropriate. As pointed out above you can already get very close WW1 conditions. You need to be careful with the mages becoming so powerful that a lone mage can single handily wipe out and entire defended positions simply by sitting in a bunker and lobbing fireballs over and over. Also if you have teleport you can now have a "paratrooper" style troop where the mage acts as the transport and can teleport in elite troops. Manipulation of the weather could be used as well.
Could you clarify more exactly what your magic entails? 523