What is the difference between a configuration state function and a Slater determinant?
Slater determinants are not eigenfunctions of the $\hat S^2$ operator, but CSFs are.

The Hamiltonian commutes with the operators for total and projected spin
\begin{align}
  [\hat H, \hat S^2] &amp;= 0 \\
  [\hat H, \hat S_z] &amp;= 0
\end{align}
Therefore, a set of common eigenfunctions to all three operators exists. As Slater determinants are eigenfunctions of $\hat S_z$, but not $\hat S^2$, using them as a basis for the electronic wave function (=eigenstate of $\hat H$), will not guarantee the (approximate) solution to be an eigenfunction of $\hat S^2$. The spin multiplicity of the found solution may not be a pure Singlet (or Doublet, Triplet, etc.).

As an example, consider a 2 electron system, with both electrons occupying different spatial orbitals. The situation with same spin for both electrons can be represented as the Slater determinant $|\alpha\alpha\rangle=\frac{1}{\sqrt{2}}[\alpha(1)\beta(2)-\alpha(2)\beta(1)]$. The spatial part is omitted here, to keep the notation short. The corresponding eigenvalue equations are then
\begin{align}
    \hat S_z |\alpha\alpha\rangle &amp;= 1 |\alpha\alpha\rangle \\
    \hat S^2 |\alpha\alpha\rangle &amp;= 2 |\alpha\alpha\rangle 
\end{align}
Thus we have $S=1$, from $S(S+1)=2$, and the spin multiplicity is $2S+1=3$, i.e. a Triplet. Here the Slater determinant directly corresponds to a CSF.

For the case of opposite spin, we have 
\begin{align}
    \hat S_z |\alpha\beta\rangle &amp;= 0 |\alpha\beta\rangle \\
    \hat S^2 |\alpha\beta\rangle &amp;= |\alpha\beta\rangle + |\beta\alpha\rangle
\end{align}
and therefore $|\alpha\beta\rangle$ is not an eigenfunction of $\hat S^2$. The expectation value for total spin would yield $\langle\hat S^2\rangle=1$, which is neither a Singlet nor a Triplet (not even a Doublet where $S(S+1)=0.75$).

This can be fixed by taking suitable linear combinations of Slater determinants. In this example we have 2 options:
\begin{align}
    |^1\Psi\rangle &amp;= \frac{1}{\sqrt{2}} \left( |\alpha\beta\rangle - |\beta\alpha\rangle \right) \\
    |^3\Psi\rangle &amp;= \frac{1}{\sqrt{2}} \left( |\alpha\beta\rangle + |\beta\alpha\rangle \right)
\end{align}
This yields the eigenvalue equations
\begin{align}
    \hat S^2 |^1\Psi\rangle &amp;= 0 |^1\Psi\rangle \\
    \hat S^2 |^3\Psi\rangle &amp;= 2 |^3\Psi\rangle
\end{align}
which correspond to a Singlet and a Triplet state respectively.

Overall, this yields 1 Singlet component $|^1\Psi\rangle = \frac{1}{\sqrt{2}} \left( |\alpha\beta\rangle - |\beta\alpha\rangle \right)$, and the 3 Triplet components $|^3\Psi\rangle = \frac{1}{\sqrt{2}} \left( |\alpha\beta\rangle + |\beta\alpha\rangle \right)$, $|\alpha\alpha\rangle$ and $|\beta\beta\rangle$.

For the arithmetic on how to apply the $\hat S_z$ and $\hat S^2$ operators to multi-electron systems, see Chapter 2.5 in Modern Quantum Chemistry by A. Szabo and N. Ostlund.