Energy in a system may take on various forms (e.g. kinetic, potential, heat, light). The law of conservation of energy states that energy may neither be created nor destroyed. Therefore the sum of all the energies in the system is a constant.
The most commonly used example is the pendulum:

The formula to calculate the potential energy is:
The mass of the ball = 10kg
The height, h = 0.2m
The acceleration due to gravity, g = 9.8 m/s^2
Substitute the values into the formula and you get:
PE = 19.6J (J = Joules, unit of energy)

As the blue ball is approching the purple ball position the PE is decreasing while the KE is increasing. At exactly halfway between the blue and purple ball position the PE = KE.

At this point, theoretically, all the PE has transformed into KE> Therefore now the KE = 19.6J while the PE = 0.

We can now say and understand that:
The sum of PE and KE is the total mechanical energy:
NOTE: This is with the abscence of outside forces such as friction
Using our common sense we know that it's impossible for the pendulum to swing higher than the height h without giving it a push yourself. If there was no friction, the pendulum would swing back and forth forever because of the law of conservation of energy.