The energy stored in the form of potential energy in the capacitor is given as
U=12CV2
Storing energy in a capacitor is amount of work done is transporting charge from one plate to the other.
The inductor stores energy in the magnetic field that is created by it when it carries current. The relation is given as
U=12LI2
The energy in the inductor remains stored as long as the current keeps on flowing through it.