The escape speed \(v_e\) of a body of mass \(m\) from a body of mass \(M\) and radius \(R\) is given by equating the kinetic energy to the negative of the potential energy.
\begin{equation*}
\frac{1}{2} m v_e^2 = G_N \frac{M m}{R}.
\end{equation*}
This gives
\begin{equation*}
v_e = \sqrt{\frac{2G_N M }{R} }.
\end{equation*}
The root-mean square speed of a molecule when in the environment of temperature \(T\) is
\begin{equation*}
v_\text{rms} = \sqrt{\frac{3k_B T}{m}}
\end{equation*}
Equating the two speeds will give the condition we seek in this problem.
\begin{equation*}
\frac{3k_B T}{m} = \frac{2G_N M }{R}
\end{equation*}
The temperature will be
\begin{equation*}
T =\frac{2G_N Mm }{3 k_B R}.
\end{equation*}
Now, we put in the following numbers.
\begin{align*}
\amp M = 2\times 10^{30}\ \text{kg}\ \ \text{(Mass of Sun)}\\
\amp m = 4\times 10^{-3}\ \text{kg}/6.022\times 10^{23} \ \ \text{(Mass of one He atom)}\\
\amp R = 7.0\times 10^9 \ \text{m}\ \ \text{(Radius of Sun)}.
\end{align*}
These give the following for \(T\text{.}\)
\begin{equation*}
T = 9 \times 10^6 \ \text{K}.
\end{equation*}
This temperature is much larger than the surface temperature of the Sun.