Energy restores over time, even when the game isn't active. Every 3 minutes you regain 1 energy point.
When the level of your experience increases, the energy also fully restores, and its supply increases.
You can speed up energy restoration or increase the available supply using special power-ups and energy drinks.