We know that the value of 'g' decreases as we go up from the surface of the Earth. In other words the value of 'g' decreases as the distance from the centre of the Earth increases.
Thus, the value of g on the surface of the Earth will be more than the value of g' at an altitude 1000 m above the Earth.
Now, the potential energy of an object is given as mgh.
The same object is raised to the same height of 5m in both the cases. Thus there will be a difference in the value of their potential energy as the value of g is different in both the cases. And the value of potential energy of the object on the surface of the Earth will be more than the value of the potential energy of the same object at an altitude of 1000 m above the sea level.