How does U = mgh when h is smaller then r?

Why does the potential energy; U, equal mgh when h is smaller then r?
use equation
F = GmM/r^2 which then leads to,
F = -GmM/r
.... Why do we say that U = mgh when h<<r?
please explain with math!!
4 answers 4