Moments of inertia are additive. Suppose you have particle $A$ with a moment of inertia $I_A$ and particle $B$ with a moment of inertia $I_B$. Then the total moment of inertia of both particles is just $I_A + I_B$.
You can imagine a ring as being made up from lots of point particles, all at a distance $R$ from the central axis. In that case the moment of inertia of the ring would be the sum of all the moments of inertia of all the point particles:
$$ I_{ring} = I_A + I_B + \, ... = m_A R^2 + m_B R^2 + \, ... $$
Since $R$ is a constant we can take $R^2$ outside the sum to get:
$$ I_{ring} = \left(m_A + m_B + \, ...\right)R^2 $$
and $m_A + m_B + \, ...$ just adds up to the total mass of all the particles $M$. so we end up with:
$$ I_{ring} = MR^2 $$
This is a special case of a general principle in calculating moments of inertia. For any body of any shape we can divide it up in to infinitesimal elements then add up their moments of inertia to get the total. In general this is done by integration, as Wet Savanna Animal explains in his answer.