The critical dimension of the superstring is $d=10$, fixed by the conformal anomaly. The total central charge for the world sheet conformal theory is therefore
\begin{equation}
c=d\left(1_\text{scalar}+\frac{1}{2}_\text{fermion}\right)=10 \times\frac{3}{2}=15.
\end{equation}
From the spacetime point of view we want to compactify on a manifold
\begin{equation}
\mathcal{M}_{10}=\mathbb{R}^{1,3} \times M_6
\end{equation}
which amounts to studying a tensor product of conformal $N=2$ theories, in which central charges add. So the $4$ scalar fields and their superpartners in $\mathbb{R}^{1,3}$ contribute
\begin{equation}
c_{\mathbb{R}^{1,3}}=4\times 3/2=6
\end{equation}
and the remaining central charge of $15-6=9$ has to come from degrees of freedom in the internal manifold. That is, the theory of the internal manifold has to be described by a $N=2$ conformal theory of central charge 9.
Comment on $N=2$:
If you start out writing down a generic worldsheet sigma-model for an internal space it is in general neither supersymmetric nor conformal. It can be shown that $N=2$ (or $N=(2,2)$ depending on notation) symmetry of the sigma model, corresponds to the internal space being a complex Kähler manifold. On top of that, conformal invariance requires it to be Ricci flat. These two conditions describe a Calabi-Yau manifold.
In other words, if you want to preserve SUSY by compactifying on a Calabi-Yau manifold, from the spacetime point of view, it corresponds to a superconformal $N=2$ theory on the worldsheet.
For technical details I would refer to Brian Greene's lectures (https://arxiv.org/pdf/hep-th/9702155.pdf) page 49, and references therein.