Step 1: The gravitational potential energy ($U$) between two masses $m_1$ and $m_2$ separated by a distance $r$ is given by:
\[
U = -\frac{G m_1 m_2}{r}
\]
Step 2: In this case, both masses are equal to $m$, so the equation simplifies to:
\[
U = -\frac{G m^2}{r}
\]
Step 3: Therefore, the correct answer is (B).
\bigskip