Work is done in raising an object from the ground to certain height against the gravity is stored in the body as a potential energy.
Consider an object of mass m. It is raised through a height h from the ground. Force is needed to do this.
The downward force acting on the body due to gravity = mg.
The work has to be done to lift the body through a height h against the force of gravity as shown in above figure.
The object gains energy to do the work done (w) on it.
work done = force x displacement
w = F x h
w = mgh [Since F=ma and a=g, therefore F=mg]
Work done is equal to potential energy of an object.
Ep = mgh
NOTE: The potential energy of an object at a height depends on the ground level or the zero level you choose. An object in a given position can have a certain potential energy with respect to one level and a different value of potential energy with respect to another level.