what groups have only elements of prime order? If there exist any group which has only elements of prime order? (except of $p$-elementary abelian, $Q_{8}$ and $D_{2p}$)
 A: There are of course (non-abelian) $p$-groups of exponent $p$, so every element is of prime order $p$ there, See for instance this 1974 article.
For an example involving two different primes, consider the following generalization of the example of Alex. Let $p$ be a prime, $n \ge 1$ and let $N$ be the additive group of the field $F$ with $p^{n}$ elements. Pick any subgroup $H$ of prime order $q$ in the multiplicative group $F^{\star}$. (Necessarily, $q \ne p$.) Then in the semidirect product of $N$ by $H$ all elements have order $p$ or $q$.
There are more examples among Frobenius groups. (The example just given is that of a Frobenius group.)
A particularly interesting one (quoted in the Wikipedia article) is a suitable semidirect product of a non-abelian group $N$ of order $p^{7}$ and exponent $7$ by an element $h$ of order $3$. This can be realized as 
$$
N = \left\{ 
\begin{bmatrix}
1 & a & c \\
  & 1 & b \\
  &   & 1 \\
\end{bmatrix} : a, b, c \in F
\right\},
$$
where $F$ is the field with $7$ elements, and
$$
h : \begin{bmatrix}
1 & a & c \\
  & 1 & b \\
  &   & 1 \\
\end{bmatrix}
\mapsto
\begin{bmatrix}
1 & 2a & 4 c \\
  & 1 & 2b \\
  &   & 1 \\
\end{bmatrix}.
$$
A: A complete answer for finite groups can be found at https://www.jstor.org/stable/2159554.  Quoting from the abstract: The finite groups with this property are exactly $p$-groups of exponent $p$, nonnilpotent groups of order $p^aq$, and $A_5$.  In particular, $A_5$ is the only non-solvable finite group with this property, and also the only group with this property whose order is divisible by more than two primes.
(Edit by David Craven: the link now points to a correction of the original (false) classification.)
