Where m is the mass of the object. Gravitational potential energy or GPE is like height energy. The higher up an object is placed the more GPE it has.
For a spring potential energy is calculated based on Hookes Law where the force is proportional to the length of stretch or compression x and the spring constant k.
This store is called gravitational potential energy. Egrav PE mgh. The gravitational potential energy U of a system of masses m 1 and M 2 at a distance r using gravitational constant G is U G m 1 M 2 r K. Energy is the most fundamental concept in physics.