  Let $I(G)$ be the edge ideal of a simple graph $G$. We prove that $I(G)^2$
has a linear free resolution if and only if $G$ is gap-free and reg$I(G) \le
3$. Similarly, we show that $I(G)^3$ has a linear free resolution if and only
if $G$ is gap-free and reg$I(G) \le 4$. We deduce these characterizations from
a general formula for the regularity of powers of edge ideals of gap-free
graphs $${\rm reg}(I(G)^s) = \max({\rm reg} I(G) + s-1,2s),$$ for $s =2,3$.
