Units and heroes start a battle with a certain amount of Mana. Mana can be gained by regenerating it over time or by drinking a Mana Potion.
Regenerating mana over time is typically a very slow process. For heroes, this problem can be reduced by having a high intelligence as each point of intelligence gives about 0.01 mana per second on top of the base regeneration. Items, certain racial researches and the arcane sphere can then grant a percentage bonus to mana regeneration. The late game racial researches are particularly useful as they also apply to your spellcasting units.
Mana Potions restore an amount of Mana depending upon the highest level of your HQ building. Mana Potions can be bought from Shops and will cost a large amount of all resources. This presents a rather interesting dilemma for the spellcaster. Mana potions are expensive and mana regeneration is slow. So the timing on when to consume mana potions becomes an important consideration. Doing it early may help to accelerate the early game or pressure the opponent. But doing it later on may prove to be more efficient.