It is well known that every group of exponent $n=2$ is abelian. I remember having seen that this is also the case for $n=3$. (can someone give a proof). How does this generalize to any $n$ or to any prime $p$.
Well, any finitely generated group G of exponent 3 is finite by a classical theorem of Burnside. And since the order of every element is 3, the order of G must be a power of 3 by Cauchy's theorem. It follows that G is a finite nilpotent group. A similar argument shows that the same is true for any finitely generated group of exponent 4. This is unknown for 5, and false for 6.
Correction: it seems (see the answer of Primoz above) that any group of exponent 3 is nilpotent, altough it can be infinite if it not finitely generated.
Every group of exponent 3 is nilpotent of class at most 3, and this bound is best possible. The question whether finitely generated groups of exponent $n$ are finite is also known as the Burnside problem. There is an excellent historical overview of this problem, along with a list of relevant references.
The result I have seen is that every finite group $G$ of exponent $3$ such as $3$ does not divide $o(G)$ is abelian.
It generalises the following way : every n-abelian group (such as $(xy)^n=x^n y^n$) that has got no element (other than $1$) whose order divides $n(n-1)$ is abelian. One can refer to J.L Alperin A classification of n-abelian groups in Canadian Journal of Mathematics (1969)