In general, there are $n$ consecutive squares that add to a square if and only if the following Diophantine equation has solutions:
$$x^2-ny^2=\frac{n(n-1)(n+1)}{3}$$
with the added parity condition that $y$ and $n$ are different parities. The value $y$ is just the sum of the first and last element of the sequence, so $$\frac{y-n+1}{2}$$ is the beginning of the sequence.
When $n$ is not square, then the nice thing about Pell-like equations is that if there is one solution with the above parity condition, there are infinitely many. In particular, then there is always a sequence of consecutive positive numbers if there is any consecutive sequence of integers.
If $n$ is a perfect square, then there is a solution if and only if $(n,6)=1$. It is not always the case that you can find consecutive squares of positive numbers in this case. But we can get a solution $m,m+1,\dots,m+n-1$ with $m=\frac{(n+1)(n-25)}{48}$ when $n$ a perfect square, which gives positive solutions except when $n=1$ and $n=25$. But $n=1$ obviously has positive solutions, so the only problem case is $n=25$. There is no positive solution when $n=25$, only a non-negative solution: $0^2+1^2\dots+24^2$ is a square.
When $n$ is not a perfect square, this condition gets harder, but the Pell-like nature of the equation gives us a way to find some solutions. For exmaple, $u^2-nv^2=n(n-1)$ has a trivial solution, so if $n+1$ is divisible by $3$ then we can find a solution to the above equation of $w^2-nz^2 = \frac{n+1}{3}$ yields a solution to the above, and it turns out you can easily show in that case that the solution satisfies the parity condition. In particular, if $n=3w^2-1$, then $(w,z)=(w,0)$ is a solution, so we know we have infinitely many non-square values of $n$, and, in particular, $n=11$ when $w=2$.
Necessary conditions when $n$ is not a square:
A. Factor $n=a^{2}b$, with $b$ square-free, then:
- If $2 \mid a$, then $2 \mid b$
- If $3 \mid a$, then $3 \mid b$
- $3$ is a square $\pmod{b}$. (Alternatively, the only primes that divide
$b$ are $2$, $3$, and primes of the form $12k \pm 1$.)
- If $3 \mid b$, then $b \equiv 6 \pmod{9}$
B.
- If $3 \mid n+1$, then $\frac{n+1}{3}$ is the sum of two perfect squares
- If $3 \nmid n+1$, then $n+1$ is the sum of two perfect squares
These can be used to exclude $n=3,...,10$:
- $3$ violates $A.4.$
- $4$ is a square and $(4,6)\neq 1$
- $5$ violates $A.3.$.
- $6$ violates $B.2$.
- $7$ violates $A.3.$
- $8$ violates $B.1.$
- $9$ is a square not relatively prime to $6$.
- $10$ violates $B.2.$
See here for some more details and some ways to explicitly construct such $n$.
I don't have sufficient conditions. The smalles number that satisfies the above conditions but for which there is no solution is $n=842$.
It is easier to come up with necessary and sufficient conditions for the question of whether there exists an arithmetic progression of length $n$ such that the sum of the squares is a square. Indeed, if $y$ and $n$ are the same parity in the above equation, that amounts to a sequence of $n$ consecutive odd numbers whose squares add up to a square.