Let $\mathbb{R}$ be the set of real numbers.  Let $f : \mathbb{R} \to \mathbb{R}$ be a function such that for all real numbers $x$ and $y,$
\[f(x^2) + f(y^2) = f(x + y)^2 - 2xy.\]Let
\[S = \sum_{n = -2019}^{2019} f(n).\]Determine the number of possible values of $S.$
Setting $y = -x,$ we get
\[2f(x^2) = f(0)^2 + 2x^2\]for all $x.$  Setting $x = 0$ in this equation, we get $2f(0) = f(0)^2,$ so $f(0) = 0$ or $f(0) = 2.$

Suppose $f(0) = 2.$  Then
\[2f(x^2) = 4 + 2x^2,\]so $f(x^2) = x^2 + 2$ for all $x.$  In other words, $f(a) = a + 2$ for all $a \ge 0.$

Setting $x = y = 1$ in $f(x^2) + f(y^2) = f(x + y)^2 - 2xy,$ we get
\[1^2 + 2 + 1^2 + 2 = (2 + 2)^2 - 2 \cdot 1 \cdot 1,\]which simplifies to $6 = 14,$ contradiction.

Otherwise, $f(0) = 0.$  Then $2f(x^2) = 2x^2,$ so $f(x^2) = x^2$ for all $x.$  In other words, $f(a) = a$ for all $a \ge 0.$

Setting $y = 0$ in $f(x^2) + f(y^2) = f(x + y)^2 - 2xy,$ we get
\[f(x^2) = f(x)^2.\]But $f(x^2) = x^2,$ so $f(x)^2 = x^2.$  Hence, $f(x) = \pm x$ for all $x.$

Then the given functional equation becomes
\[x^2 + y^2 = f(x + y)^2 - 2xy,\]or
\[f(x + y)^2 = x^2 + 2xy + y^2 = (x + y)^2.\]We have already derived this, so as far as the given functional equation is concerned, the function $f(x)$ only has meet the following two requirements: (1) $f(x) = x$ for all $x \ge 0,$ and $f(x) = \pm x$ for all $x < 0.$

Then we can write
\begin{align*}
S &= f(0) + (f(1) + f(-1)) + (f(2) + f(-2)) + (f(3) + f(-3)) + \dots + (f(2019) + f(-2019)) \\
&= 2(c_1 + 2c_2 + 3c_3 + \dots + 2019c_{2019}),
\end{align*}where $c_i \in \{0,1\}.$  We can check that $c_1 + 2c_2 + 3c_3 + \dots + 2019c_{2019}$ can take on any value from 0 to $\frac{2019 \cdot 2020}{2} = 2039190,$ giving us $\boxed{2039191}$ possible values of $S.$