Due to the definition of Conservative Forces, Gravitational force being one among many.
Potential energy is defined as energy possessed by a body by virtue of its position relative to others bodies.
It could be
- The gravitational potential energy of an object which depends on mass and distance from the center of mass of another object.
- The elastic potential energy of a deformed spring.
- The electric potential energy of an electric charge due to an electric field.
- Chemical potential energy which is dependent on the structural arrangement of different atoms in a molecule.
- Magnetic potential energy of a magnetic object having magnetic moment when placed in an external magnetic field.
- Nuclear potential energy is the potential energy of the nucleons inside the nucleus.
Since the question is about the first one listed, the discussion will be limited to Gravitational PE only. However, similar arguments can be extended suitably to other forms.
We must remember that we are dealing here with Conservative Forces.
Any conservative force is defined as a force for which the work done in moving from a point
For a conservative force an object could be moved from
This makes it possible for us to define a potential energy function which depends upon position only. In this case