Fix a finite field $k$ of $q$ elements, with additive identity $0_k$ and multiplicative identity $1_k$.
For any integer $n$, let $[n]$ be the $n$-fold sum of $1_k$. Clearly $[a + b] = [a] + [b]$ and $[a\cdot b] = [a] \cdot [b]$. Since $k$ is finite, for any $n$, in the sequence $[a]$, $[a + 1]$, $[a + 2]$, etc., there must be a repeat; let $p$ be the smallest integer so that $[a] = [a + p] = [a] + [p]$. Then $[p] = 0_k$, and in the sequence $[1], [2], [3], \ldots, [p]$, the element $[p]$ is the first nonzerozero element.
$p$ is called the characteristic of the field. Suppose $p$ were composite, with factors $1 < a \leq b < p$ so that $p = a\cdot b$. Then $0_k = [p] = [a\cdot b] = [a] \cdot [b]$, but $[a]$ and $[b]$ are nonzero because $p$$[p]$ was the first nonzerozero element in the sequence $[1], [2], [3], \ldots, [p]$. This is impossible in a field, so $p$ must be prime.
The set $\{[0],[1],[2],\ldots,[p-1]\}$ forms a subfield $k_p$ of $k$, since it is by construction closed under addition and multiplication. Thus the extension field $k$ forms a vector space over the subfield $k_p$. Being finite, this vector space is necessarily finite-dimensional, of dimension $n$, and thus has exactly $p^n$ elements. Hence $q = p^n$ for some $n$.