You gain 2 energy every 5 minutes. Energy is used to perform quests, kill monsters, bosses and also travel. Travel without a mount costs 2 energy, and with a mount - 1. If you need more energy urgently, see The King.
Training Energy Up
The maximum level you can train energy to is 99. You can reach this by a combination of training points and/or gear items that add energy such as the Zombie Horse or Fangthane. You can push it over with the mastery of The Cemetery and with Energy Gear