Each player has a maximum of 480 energy.
Energy is used in a few ways, including:
Breeding crops
Energy can be gained by the player using the following methods:
Waiting. The player will automatically get 1 energy every 2 minutes (30 per hour)
Using salad. Salad will return energy to the player, the amount depending on the star level of the salad.
(Note: Energy will not be gained if the player has no land slots available; EG: If the player rented out all of their land slots.)
Note: Some limited pets will give energy generation boost. Read more about it here.