Your mana regenerates all of the time, except for a period of five seconds after you cast a spell. In this five seconds, you have no regeneration. This is commonly called the five second rule. A spell here is defined as anything that costs mana to cast. ’mana regen / 5 seconds’ properties on items (like on Mindsurge Robe (http://wow.allakhazam.com/db/item.html?witem=18532)) however ignore the five second rule, thus giving you the specified amount of mana even during chain-casting.
One interesting note is when spells don’t cost mana, they will not start this timer, and you will continue to regen mana. Nature’s Swiftness costs no mana, and will not invoke the five second rule. Spells casted with the clearcasting state from the Elemental Focus talent also will not start the five second timer.
Totems, on the other hand, will start the five second timer.
Mana regenerates according to how much spirit you have. You do not mana regen faster if you are sitting down or standing up. You do not mana regen faster in battle or out of battle.
Regeneration starts again 5 seconds after casting is over. There is 1 tick of regeneration every 2 seconds. Its value depends on class and spirit :