The statement is equivalent to
(1) $(\mathbb Z/m\mathbb Z)^\times$ is cyclic if and only if its largest two subgroup is,
which results immediately from
(2) $(\mathbb Z/m\mathbb Z)^\times$ is cyclic if and only if $m$ is of the form $2, 4, p^j, 2p^j$, where $p$ is an odd prime.
Statement (2) is proved on page 24 of Alan Baker's A concise introduction to the theory of numbers.
EDIT 1. Here is a slightly expanded version of the above answer.
For any positive integer $m$, let $G_m$ be the multiplicative group of the ring $\mathbb Z/m\mathbb Z$, and $T_m$ the largest $2$-subgroup of $G_m$.
Denote by $S$ the set of those positive integers which are equal to $2$, or to $4$, or to a power of an odd prime, or to twice a power of an odd prime.
Let $m$ be a positive integer. We claim:
$(3)$ If $m$ is in $S$, then $G_m$, and a fortiori $T_m$, are cyclic.
$(4)$ If $m$ is not in $S$, then $T_m$, and a fortiori $G_m$, are not cyclic.
In case $(4)$, the group $G_m$ is a product of two groups of even order, and the conclusion is clear.
To prove $(3)$ we can assume that $m$ is a power $p^n$ of an odd prime $p$. We can also suppose that the exponent $n$ is at least $2$.
Let $a$ be a primitive root mod $p$. In particular is $a^{p-1}$ is of the form $1+pb$.
Put $c:=a+px$, and let's try to choose $x$ in such a way that $c$ is a primitive root mod $p^n$.
By computing mod $p$ we see that the order of $c$ in $G_m$ is not a power of $p$. Thus, it is enough to check that $c^{(p-1)p^{n-2}}$ is not congruent to $1$ mod $p^n$. We have
$$
c^{p-1}\equiv1+p\ (b+(p-1)\ a^{p-2}\ x)\ \bmod\ p^2,
$$
and thus $c^{p-1}\equiv1+p$ mod $p^2$ for some $x$. By induction we get
$$
(c^{p-1})^{p^i}\equiv1+p^{i+1}\ \bmod\ p^{i+2}
$$
for all positive integers $i$, and in particular
$$
(c^{p-1})^{p^{n-2}}\equiv1+p^{n-1}\ \bmod\ p^n.
$$
QED
EDIT 2. The following fact has been used. Let $G$ be a finite (multiplicative) abelian groups. Then $G$ can be decomposed as a product of cyclic groups. Let $n$ be the number of even factors. Then the number of solutions $x$ to the equation $x^2=a^2$ is $2^n$, where $n$ is the number of even order factors in the decomposition. (This shows in particular that $n$ depends only on $G$.)