Suppose that $G$ is a group where $|G| = pq$ for prime $p$ and $q$. Suppose further that $|Z(G)| = q$. Thus, $Z(G) \cong Z_q$ (it is a cyclic group). Moreover, we see that
$$ |G/Z(G)| = \frac{|G|}{|Z(G)|} = \frac{pq}{q} = p. $$
Thus $G/Z(G)$ is also a cyclic group.
Why does this imply that $G$ is an abelian group? Our professor stated this today in lecture, and I can't seem to find a concrete reason why.