The $8\pi$ appears when you take the classical limit of the field equations.
Let's suppose we have derived the field equations through the variational principle
\begin{equation}
\delta S = \delta \int_\Omega \mathcal{L} \sqrt{-g} \ d^4x = 0,
\end{equation}
we can separate the lagrangian into a term that corresponds to matter-energy ($\mathcal{L}_M$) and another that corresponds to the gravitational field ($\mathcal{L}_G$), so that we write
\begin{equation}
\mathcal{L} = \mathcal{L}_G - 2 \ \kappa \ \mathcal{L}_M.
\end{equation}
$\mathcal{L}_G = R$ ($R$ is the curvature invariant), that gives us the the Einstein-Hilbert Action.
\begin{equation}
\delta S = \delta \int_\Omega \left( R - 2 \kappa \mathcal{L}_M \right) \sqrt{-g} \ d^4x = 0
\end{equation}
Subtituting the above equation in the action, you get:
\begin{equation}
R_{\mu \nu} - \frac{1}{2} R g_{\mu \nu} = \kappa T_{\mu \nu},
\end{equation}
where $T_{\mu \nu}$ is the Stress-Energy tensor, and depends on $\mathcal{L}_M$.
Since Newtonian mechanics is very well tested, it's expected that it's a limit case of this equation, so we assume a weak field approximation: the Minkowski metric ($\eta_{\mu \nu}$) is under a small perturbation ($h_{\mu \nu}$ and the the mass is perfect fuild ($T_{\mu \nu} \approx T_{00} = \rho c^2$).
\begin{equation}
g_{\mu \nu} = \eta_{\mu \nu} + h_{\mu \nu}.
\end{equation}
If you work with this, you arrive at:
\begin{equation}
\frac{\partial^2 h_{00}}{\partial x^k \partial x^k} =\kappa \rho c^2
\end{equation}
Comparing with the Newtonian equation for the potencial (Poisson's equation):
\begin{equation}
\frac{\partial ^2\Phi}{\partial x^k \partial x^k} = 4 \pi G \rho
\end{equation}
Then, we can assume that $h_{00} = \frac{2}{c^2} \Phi$ (The $1/c^2$ term is necessary to adjust the dimensions) and, therefore, $\kappa = 8 \pi G/c^4$:
\begin{equation}
R_{\mu \nu} - \frac{1}{2} R g_{\mu \nu} = \frac{8 \pi G}{c^4} T_{\mu \nu}.
\end{equation}
Nothing to do with dimensions.
(Since you said you are studying GR, I am assuming you kind of know topics like curvature invariant and variational principle).