Energy is needed to do various things.
You will receive a default of 1 energy per 5 minutes or 12 energy per hour with the maximum amount of 300 energy in total. If you do not use up your stored energy, it will remain at 300 until you do.
Most actions require 1 energy per turn with the exception of performing robbery, barn arson and throwing parties. Shopping, selling items via trading, buying items via trading and changing your shout does not use up energy. Changing your name and working uses 1 energy per turn.
Fight actions use up an amount of energy dependant on the resources you have. For example, robbery and barn arson uses up 1 energy per 1000 bros to a maximum of 20 energy if you have 20,000 bros and above. Parties use up 1 energy per house to a maximum of 20 energy if you have 20 houses and above.