Energy is capped at a top value based on your level. The only way to exceed this amount is through purchasing it in the store; purchases always add to whatever you've already got.  
If you've maxed your energy, you'll want to use up some of that energy before adding more that is earned in-game.