How to show that the nth power of a $n \times n$ nilpotent matrix equals to zero $A^n=0$
If $A^m=0$, then the minimal polynomial of $A$ divides $x^m$. The minimal polynomial has degree at most $n$ by Cayley-Hamilton.
Here is an alternative approach that doesn't rely on knowing anything about minimal polynomials, or Cayley-Hamilton. Consider $A$ as a linear transformation on $K^n$ if $K$ is your base field. Let $M_1$ be the range of $A$, i.e., $M_1=A(K^n)=\{Av:v\in K^n\}$. For $j>1$ let $M_{j}=A(M_{j-1})$ be the image of $M_{j-1}$ under $A$. In other words, $M_j=A^j(K^n)$, and we can include $M_0=K^n$ for convenience. Note that each $M_j$ is a subspace and $M_j\subseteq M_{j-1}$ for all $j$.
We know that $A^m=0$, so $M_m=\{0\}$. If for some $j$, $M_j=M_{j-1}$, then $M_{j+1}=AM_{j}=AM_{j-1}=M_j$, so $M_{j-1}=M_j=M_{j+1}=M_{j+2}=\cdots$. It follows that $M_j$ must be $\{0\}$ in such cases. This implies that all of the containments are proper until you get to $\{0\}$, so there is an $m_0$ such that $\{0\}=M_{m_0}\subsetneq M_{m_0-1}\subsetneq\cdots\subsetneq M_2\subsetneq M_1\subsetneq K^n$. Since there are $m_0$ proper containments of subspaces and $K^n$ is $n$ dimensional, this implies that $m_0\leq n$. Since $M_{m_0}=\{0\}$ and $M_{m_0}$ is the range of $A^{m_0}$, it follows that $A^{m_0}=0$, and finally $A^n=A^{m_0}A^{n-m_0}=0$.
From $A^m=0$ you learn that all eigenvalues of $A$ are zero. So the Jordan form of $A$ is strictly upper triangular, and it is an easy exercise to show that the $n^{\rm th}$ power of an upper triangular matrix with zero diagonal is zero.
Since this question is marked as duplicate from one that explicitly asks not to use the Cayley-Hamilton theorem I will not do that. Nor will I use Jordan normal forms (which require an algebraically closed field).
Let $m\in\Bbb N$ be minimal such that $A^m=0$; then by assumption there are (unless $m=0$, which implies $n=0$ and is boring) vectors$~v$ such that $A^{m-1}\cdot v\neq0$; one needs to prove $m\leq n$. There are various ways to proceed, I'll mention three.
(1) Putting $v_i=A^{m-i}\cdot v$ for $0<i\leq m$, one has $v_i\in\ker(A^i)\setminus\ker(A^{i-1})$, which shows that the chain of subspaces $\{0\}=\ker(A^0)\subseteq\ker(A^1)\subseteq\ker(A^2)\subseteq\cdots$ is strictly increasing until reaching $\ker(A^m)=k^n$, and considering dimensions one gets $n\geq m$.
(2) Those vectors $v_1,\ldots,v_m$ are linearly independent, for otherwise, if one considers the first $k$ for which $v_1,\ldots,v_k$ are linearly dependent, then $k>1$ (since $v_1\neq0$ by construction), but applying $A$ to a dependency relation one gets a shorter one, contradicting minimality. From the independence one gets $m=\dim\langle v_1,\ldots,v_m\rangle\leq n$.
(3) Putting $V_i=\ker(A^i)$ for brevity (any $i\in\Bbb N$), each $V_{i+1}$ is (by definition) the inverse image under the linear map defined by $A$ of $V_i$. Then that linear map induces a map $V_{i+2}/V_{i+1}\to V_{i+1}/V_i$ that is injective (by the mentioned inverse image property). It follows that the sequence of natural numbers $(\dim(V_{i+1}/V_i))_{i\in\Bbb N}$ is weakly decreasing, so it cannot attain the value $0$ for any $i<m$. Then immediately $\dim(V_i)\geq i$ for all $i\leq m$, and in particular $n=\dim(V_m)\geq m$. [The main interest of this approach is that it gives additional and quite useful information beyond what was asked for.]