Dear Student,
Let us consider that an object of mass m is kept on the ground so the force of gravity due to gravitational force g that acts on the object is,
If the object is uplift to height then the work is done against the gravity. we know that the work done is equal to the product of force applied to raise and the displacement or the height up to which the object is uplifted. Thus if the object is uplifted to the height h then mathematically work done is expressed as,
Using equation of force due to gravity in the above equation we get,
This is an equation for the work done due to gravitational force.
So, the work done to uplift the object against gravity and to take it to a height h is stored and is converted as potential energy of the object, so we can write as,
Regards.