This term refers to how much energy an object has because of where it is in a gravitational field. It's usually discussed in terms of questions like "if a 2kg ball is suspended 5m above the floor, how much gravitational potential energy does it have?"
The formula for finding this is PEgrav = m*g*h
where m is mass, g is the acceleration due to gravity, and h is height. Here's a link
The gravitational force between any two objects of mass m and M is the exertion force between the two objects separated by the distance R. Therefore, F = GM*m/(R+x)^2 is gravitational force at a point R+x from the from the centre of earth and x from the surface. The potential energrgy is on account of the object away by a distance of x from the surface against the gravitational force. Therefore,
PE = Integration Fdx , x from 0 to h = Integration of [GMm/(R+x)^2]dx, x from 0 to h = [-GMm/(R+x)] x=0 to x= h
=GMm/(R)-GMm/(R+h) = [GMm/(R(R+h))]h
=mghR^2/(R(R+h)) = mghR/(R+h), as g = GM/R^2.
The expression takes care of the varying gravitational force due to varition distance between the objects.(Here, earth and the object).
Gravitational potential energy refers to the energy possessed by an object by virtue of its position with respect of the ground level. To lift an object above the ground level some energy is used up to overcome the resistance of gravitational pull. The object so raised can be made do release this energy by allowing it to fall back to the ground level under the influence of gravity. Fir example if one of a string passing over a frictionless pulley is attached to this object, and the other end is attached to another object of equal mass, the drop of the first object can be used to lift the other one.
The amount of the gravitational potential energy is directly proportional to the mass and vertical distance of the object from ground level. This energy can be calculated using the following formula:
Potential Energy = m*h*g
m = Mass of the object
h = Vertical distance of the object from ground
g = Acceleration due to gravity