I'm afraid there isn't a nice simple solution for this. The problem is that the result depends on the equation of state of the stuff inside your sphere. The pressure inside the sphere compresses the stuff in the sphere and that increases the density which in turn affects the gravity and therefore pressure. How much the stuff compresses depends on its compressibility, and that is a property of whateverthe stuff is. There may also be phase transitions e.g. if you take a big enough ball of water the pressure will cause the water to solidify to ice at some depth then further transition to the many different crystal phases that ice has at different pressures.
Wald discusses the interior metric in section 6.2 of his book General Relativity, but even there he treats only the case of a perfect fluid. The derivation takes many pages so I won't reproduce it here. I'll give only the final result, which is:
$$ ds^2 = -e^{2\phi}dt^2 + \left(1 -\frac{2m(r)}{r}\right)^{-1}dr^2 + d\Omega^2 $$
The mass function $m(r)$ is the mass within the radius $r$ and is given by:
$$ m(r) = 4\pi \int_0^r \rho(r')r'^2 \,dr' $$
The time function $\phi$ is given by:
$$ \frac{d\phi}{dr} = \frac{m(r) + 4\pi r^3 P}{r(r - 2m(r))} $$
To calculate the time dilation you would need to specify the properties of your matter and use those properties to (probably numerically) calculate $\phi$.
You mention the specific case of a neutron star, but I have never worked in that area so I can't comment beyond saying that it's a complicated problem and there is a huge volume of literature on the subject. The simplified case is the Tolman, Oppenheimer, Volkoff equation, though simple is a misleading word to use for it!