When we assemble a system of particles in a given configuration and shape, the work done against the gravitational forces of the system will be considered as the interaction potential energy of the system. Similarly, for a single body, the interaction energy of all the particles of the body is called gravitational self-energy of the body.
Same can also be defined as the work done in assembling the body by bringing all its particles from infinity to the given mass and shape of the body. To understand the detailed explanation, watch the video below:
Gravitational Self-Energy of a Uniform Hollow Sphere: This can be calculated by finding the work done in bringing an elemental mass dm from infinity to the surface of a hollow sphere and integrating the same over the whole mass of the shell. The process is explained in the video below:
Gravitational Self-Energy of a Uniform Solid Sphere: This can be calculated by considering a solid sphere of radius x and we find the work done in bringing an elemental mass dm from infinity to the surface of this sphere in increasing the radius of sphere by dx, then we integrate the work done in making the sphere from its radius limits 0 to R for the whole mass of sphere. The process is explained in the video below: