$\mathbb Z/p^r\mathbb Z$ has $p^r$ elements.
$(\mathbb Z/p^r\mathbb Z)^\times$ is a subset, having removed all the non-invertible elements: that is exactly the multiples of $p$. Those are $p,2p,3p,\ldots,p^{r-1}p$ so there are $p^{r-1}$ of them.
So there are $p^r - p^{r-1} = p^{r-1}(p-1)$ units in $\mathbb Z/p^r\mathbb Z$.
We can extend this to $\mathbb Z/ab\mathbb Z$ where $(a,b) = 1$, by chinese remainder theorem this is isomorphic to $\mathbb Z/a\mathbb Z \times \mathbb Z/b\mathbb Z$ so has the same number of units, hence $|(\mathbb Z/ab\mathbb Z)^\times|=|(\mathbb Z/a\mathbb Z)^\times||(\mathbb Z/b\mathbb Z)^\times|$.
One defines the Euler totient function $\varphi(n) = |(\mathbb Z/n\mathbb Z)^\times|$ and we have
- $\varphi(p^r) = p^{r-1}(p-1)$
- $\varphi(ab) = \varphi(a)\varphi(b)$ when $(a,b)=1$