Gravitational potential energy
We can define a potential energy in a conservative force field $\v F$: $$ \begin{align*} \v F &= -\nabla U \\ dU &= -\v F\cdot d\v r \\ U(\v r) - U(\v r_0) &= -\int_{\v r_0}^{\v r} \v F(\v r')\cdot d\v r' \end{align*} $$ Physically, potential energy is the work done by an external force against the field in moving a body from [the point of zero potential energy] to the present location at constant velocity.
We define a gravitational potential $$ \begin{align*} \Phi = \frac{U}{m} \implies \v g = -\nabla\Phi. \end{align*} $$ We set $\Phi(\infty) = 0$. A point mass source gives $$ \begin{align*} \Phi(\v r) = -\frac{GM}{r} \end{align*} $$ To add a new point mass $m$ to a system at position $\v r$, the potential energy gained is $$ \begin{align*} U(\v r) = -\sum_i \frac{GmM_i}{|\v r - \v R_i|}. \end{align*} $$ The total gravitational potential energy of a system is the potential gained by bringing the masses together from infinity: $$ \begin{align*} U = -\sum_{i<j} \frac{GM_iM_j}{r_{ij}} = -\frac{1}{2}\sum_{i\neq j} \frac{GM_iM_j}{r_{ij}} = \frac{1}{2}\sum_i M_i\Phi_i \end{align*} $$ where $\Phi_i$ is the potential at the position of $M_i$ due to all other masses.
For example, the gravitational potential energy of a uniform sphere with mass $M$ and radius $a$ is $$ \begin{align*} U = -\frac{3}{5}\frac{GM^2}{a}. \end{align*} $$ (Derivation)