Potential Energy is energy that can be stored in a physical system and has the ability to be transformed into kinetic energy.
As the body loses potential energy it gains kinetic energy or vice versa.
Gravitational Potential Energy
It is the energy that corresponds to the work that the Weight force performs.
It is obtained when we consider the displacement of a body vertically, originating from the reference level (soil, floor of a room,…).
As the body falls it gets faster, that is, it gains Kinetic Energy, and as the height decreases, it loses Potential Gravitational Energy.
Elastic Potential Energy
It corresponds to the work that the Elastic force does.
Since elastic force is a variable force, your work is calculated by calculating the area of your graph, which Hooke's Law says is:
As the area of a triangle is given by: