I tried to answer this question by trying to do calculations with some primes.
- $\Bbb Z_2$ has two elements: 0 and 1 which satisfy the request
- $\Bbb Z_3$ has three elements: 0,1,2. So 0 and 1 satisfy the request but 3 too because $3^5 \pmod3\equiv3$
In general, I've noticed that in addition to 0 and 1 the last element of $\Bbb Z_p$ always satisfies the request. (e.g. for $\Bbb Z_{13}$ the last element is $12$ and $12^5 \equiv12 \pmod{13}$).
So I tried to formalize this result by using the Fermat's Little Theorem without any concrete success. But I'm reasonably sure that only with $p=2$ do we have a $\Bbb Z_{p}$ with exactly two elements that satisfy $x=x^5$.
Any suggestions?
Since $\mathbb{Z}_p$ is a field (and an integral domain, obviously), we can factorize it as $x(x^4-1)=x(x^2+1)(x-1)(x+1)=0$ and consider each factor separately.
So, $x=0,-1,1$ are always solutions of the equation. The only $p$ that gives two solutions is when $-1=1$ which is possible only when $p\mid 1-(-1)=2$. Since $p$ has been assumed to be prime, $p=2$ and this answers your question.
We can further this analysis by remembering the theorem that says $x^2=-1$ in $\mathbb{Z}_p$ if and only if $p=4k+1$. In this case, we can have at least $4$ solutions.