I'm having a bit of trouble understanding the gravitational potential energy. Suppose I have two masses $m$ and $M$ rotating around one another. Theres the gravitational force between them $F=-G\frac{mM}{r^2}$ and there's the potential energy $U=-G\frac{mM}{r}$.

Is the potential energy here the energy of both masses? of only one of them and the other one has the exact same energy? What is the total energy and is it easier to express with effective energy/center of mass system?

What is the energy of each mass and what is the energy of the entire system?