Let take an closed superstring propagating freely in a flat space-time as an example. There is a gauge, called conformal gauge, where the action of the string is a two-dimensional conformal field theory (CFT) in a cylinder:
$$
S=\frac{1}{4\pi}\int d^2z\left(\frac{2}{\alpha'}\partial X^{m}\bar{\partial}X_m+\psi^{m}\bar{\partial}\psi_m+\tilde{\psi}^{m}\partial\tilde{\psi}_m \right)
$$
where the energy-momentum tensor:
$$
T(z)=-\frac{1}{\alpha'}\partial X_{m} \partial X^{m}-\frac{1}{2}\psi^{m}\partial\psi_{m}
$$
should be imposed to satisfy $T(z)=0$ as a constraint. An additional constraint should be imposed as well:
$$
F(z)=i\left(\frac{2}{\alpha'}\right)^{1/2}\psi^{m}\partial X_m =0
$$
but is irrelevant here.
Those are, classically, first-class constraint and can be dealt by the BRST-quantization in the absence of anomalies.
A central charge is a property of CFTs, a number $c$ that measure how the energy-momentum tensor $T(z)$ of the theory deviates from a tensor law under conformal transformations $\delta z=v(z)$:
$$
\delta T(z)=\left[-\frac{c}{12}\partial^3v(z)\right]_{non-tensor\,law}+\left[-2\partial v(z) T(z)-v(z)\partial T(z)\right]_{tensor\,law}
$$
After quantization, we can only recover the closed string action from this CFT if $c=15$. If $c\neq 15$ the quantization of this CFT will produce an extra degree of freedom if we try to recover the closed string action, and this degree of freedom breaks Lorentz symmetry. You can see more about here. This happens because in quantum mechanics, symmetries may be incompatible with one another, a phenomena called anomaly. The Lorentz symmetry of the space-time is incompatible with gauge symmetries of the string. All this anomalies cancel for $c=15$. (You need to do the math to know why $15$).
Ok, so each $X_m$ contribute with $+1$ for $c$ and $\psi_m$ contributes $+1/2$. For a space-time with $D$ dimensions, $m=1,2,...,D$, then $c=3D/2$. Imposing $c=15$ implies $D=10$. This means that the gauge symmetries of the string is compatible with Lorentz symmetry just in $10$-dimensional space-time. You can give up about the gauge symmetries or the Lorentz symmetry obtaining a different theory. For giving up the Lorentz symmetry you end up with a non-critical string theory. For giving up the gauge symmetry you end up with a theory that we don't know how to construct consistent interactions (plus, is a theory without massless particles in the low-energy regime).
We have a summary:
- to quantize string theory, preserving all the symmetries, the central charge must be $c=15$ for superstrings and $c=26$ for bosonic strings.
- Each dimensions contribute $+3/2$ for the superstring and $+1$ for the bosonic string.
- Then, superstring must live in $D=10$ space-time and bosonic strings must live in $D=26$ space-time.