This may just be a simple Misconception Question, here goes:
Definition for Gravitational Potential Energy:
The work done by gravity to pull an object to the ground.
$E=-(\frac{GMm}{r}-\frac{GMm}{R})$
Where, $r =$ Distance from Centre of Mass , $R =$ Radius of EarthExample:
Object of 1 kg released from 1 meter on the surface of Earth
$E=-(\frac{GMm}{r}-\frac{GMm}{R})$
$E = -(\frac{( 6.67 x 10^{-11}Nm^2kg^{-2} )(6.0x10^{24}kg)(1kg)}{6.4x10^6m + 1m}-\frac{( 6.67 x 10^{-11}Nm^2kg^{-2} )(6.0x10^{24}kg)(1kg)}{6.4x10^6m})$
$E = 9.77J$Which is quite consistent from the formula unless $h$ is too big
$E = mgh$
$E = (1kg)(9.81ms^{-1})(1m)$
$E = 9.81J$The work done by gravity to pull an object from infinity to point 'r'.
$E=-\frac{GMm}{r}$
Where, $r =$ Distance from Centre of Mass
So,
Question is why are they using the same name if they don't represent the same thing?