A matrix is nilpotent if and only if its only eigenvalue is 0.
Theorem. A square matrix $A$ is nilpotent if and only if its only eigenvalue is 0.
Proof ($\Rightarrow$): If $A^k = 0$ and $Av = \lambda v$ with $v \neq 0$, then $A^k v = \lambda^k v = 0$, so $\lambda = 0$.
Proof ($\Leftarrow$): If 0 is the only eigenvalue, the characteristic polynomial is $\det(\lambda I - A) = \lambda^n$. By the Cayley-Hamilton theorem, $A^n = 0$, so $A$ is nilpotent.
Example. $A = \begin{pmatrix} 0 & 1 & 2 \\ 0 & 0 & 3 \\ 0 & 0 & 0 \end{pmatrix}$ has only eigenvalue 0 (upper triangular with zeros on diagonal), so $A^3 = 0$.