Let $G$ be a cyclic group of order $n$, and let $a\in G$ be a generator. Let $d$ be a divisor of $n$.
Certainly, $a^{n/d}$ is an element of $G$ of order $d$ (in other words, $\langle a^{n/d}\rangle$ is a subgroup of $G$ of order $d$). If $a^t\in G$ is an element of order $d$, then $a^{td}=e$, hence $n\mid td$, and thus $\frac{n}{d}\mid t$. This shows that $a^t\in \langle a^{n/d}\rangle$, and thus $\langle a^t\rangle=\langle a^{n/d}\rangle$ (since they are both subgroups of order $d$). Thus, there is exactly one subgroup, let's call it $H_d$, of $G$ of order $d$, for each divisor $d$ of $n$, and all of these subgroups are themselves cyclic.
Any cyclic group of order $d$ has $\phi(d)$ generators, i.e. there are $\phi(d)$ elements of order $d$ in $H_d$, and hence there are $\phi(d)$ elements of order $d$ in $G$. Here, $\phi$ is Euler's phi function.
This can be checked to make sense via the identity $\sum_{d\mid n}\phi(d)=n.$