I'll do the math here. Let's imagine a gravitationally bound ball of Hydrogen in space. If we're on the periphery then we're pretty correct in taking the acting gravitation field to be constant. This is mostly correct for Earth's atmosphere as well as anywhere near the surface of the sun.
Then we'll do isothermal assumption, this might be close to reality for some of our outer gas planets. It makes the state equation $P =R_{specific}T \rho$, which I'll denote $P=R_T \rho$. We're left with a differential equation. For the boundary condition we'll start at the edge of the opaque region, position $R$, and denote the pressure there $P_0$.
The differential equation comes from the hydrostatic balance. This is a $\Delta P=\rho g \Delta h$ analog. Approximating the gravitational field as constant gives an exponential function.
$$ \frac{dP}{dr} = - \rho(r) g(r) = - \frac{ P(r)}{R_T} g$$
Let's then imagine that whatever emission or reflection process we're talking about requires a certain mass-thickness of gas, $\mu$. This layer technically extends out to infinity. Observe that the pressure at $R$ is given by the gravitational field times the mass thickness above it so $P_0=\mu g$, but it turns out we don't need that. Let $\delta = r-R$ as a more convenient radial coordinate.
$$ P(r) = P_0 e^{ - \frac{ g}{R_T} \delta } $$
It should be apparent that the fuzzy layer doesn't terminate at a defined point, but we can look to a metric for a sort of half-thickness of it, which I will write $\Delta r = \ln{(2)} / (g/R_T)$. This is our best metric for the "thickness" of the photosphere.
To prove that that gas giants should, in fact, not be fuzzy, it would be sufficient to show $\delta$ is small relative to $R$. We could do that, or we could take the easy way and just show the ratio goes to zero as $R$ gets big. Either way, we'll write the radio of the thickness of the photosphere to the radius.
$$ \frac{\Delta r}{R} = \frac{ \ln{(2)} / (g/R_T) }{ R } = \frac{ \ln{(2)} R_T }{ g R } $$
Within this, we'll have speculate about the gravity, and the total mass of the object by extension. I'll say it's a given average density, since the observed densities of planets and stars in our own solar system tend to hover around a single order of magnitude of each other. This is even true for the sun, since high enough gravitational pressure creates another source of outward pressure - fusion.
$$ g = \frac{ M G }{R^2} = \frac{ \rho 4/3 \pi R^3 G}{R^2} = \frac{4 \rho \pi R G }{ 3}$$
$$ \frac{\Delta r}{R} = \frac{ 3 \ln{(2)} R_T }{ 4 \rho \pi G R^2 } $$
Now let's use values. We will specify Hydrogen gas and a temperature of $300 K$, giving a value for the state equation.
$$ R_T = R_{specific} T = \left( 4,124 \frac{J}{kg K} \right) \left( 300 K \right) = 1.24 \times 10^{6} \frac{J}{kg} $$
For the density I'll use $3 g/cm^3$. I felt strongly that the mass thickness should be required, but the equations disagreed with me, and finally I seem to have convinced myself that we don't need it. Consider that if the required mass thickness changed, the radius that defines the photosphere would also change. Since we assume to know the radius, it just doesn't come into play.
At this point we can calculate. I will report the photosphere thickness to radius ratio for different masses, as mass is the only variable left.
- Earth - 0.25%
- Jupiter - 0.02%
- the Sun - 0.0002%
How convincing is this? The atmosphere of the Earth drops pressure by 1/2 sea level at about $6 km$, which compares to a radius of about 1000x that, leading to an expected value of 0.1%... but I assumed Hydrogen and the atmosphere isn't Hydrogen, so it sounds pretty spot-on. Note that this does not suggest that the photosphere of the Earth could be $6 km$ of our current atmosphere, but instead that if the ground wasn't there (the planet wasn't rocky), then as you descended below sea-level pressure, half of the required mass-thickness for the photosphere would be located within a region of $6 km$ somewhere down there.
The formula I found seems to be consistent with the empirical evidence we are seeing here.