Let $f(n)$ denote the number of (isomorphism classes of) groups of order $n$. A couple easy facts:


If $n$ is not squarefree, then there are multiple abelian groups of order $n$.
If $n \geq 4$ is even, then the dihedral group of order $n$ is non-cyclic.


Thus, if $f(n) = 1$, then $n$ is a squarefree odd number (assuming $n \geq 3$). But the converse is false, since $f(21) = 2$.

Is there a good characterization of $n$ such that $f(n) = 1$? Also, what's the asymptotic density of $\{n: f(n) = 1\}$?

$f(n)=1$ if and only if $\gcd(n,\phi(n))=1$, where $\phi$ is the Euler phi-function. These $n$ are tabulated at http://oeis.org/A003277

The result is found in Tibor Szele, Über die endichen Ordnungszahlen, zu denen nur eine Gruppe gehört, Comment. Math. Helv. 20 (1947) 265–267, MR0021934 (9,131b). 
