From section 4.8.5 of the manual, you can use every axis legend:
\pgfplotsset{every axis legend/.append style={
at={(0,0)},
anchor=north east}}
Code: (partially from manual )
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.7}
\pgfplotsset{every axis legend/.append style={
at={(0,0)},
anchor=north east}}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}
\end{document}
Instead of the /.append style, it is possible to use legend style as in the following example. It has the same effect.
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={
at={(0,0)},
anchor=north east}]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}
\end{document}

As percusse mentioned in comment, you can fine tune the position by at={(axis description cs:0,-0.1)} as in:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={
at={(0,0)},
anchor=north east,at={(axis description cs:0,-0.1)}}]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}
\end{document}

anchor=north west, its exactly what I want but the x-axis labels are hidden by the legend. Any proposal how to circumvent this problem? – Thomas W. Nov 19 '12 at 13:12anchor=north west,at={( xticklabel cs:1)}oranchor=north west,at={(axis description cs:1.05,-0.05)}– percusse Nov 19 '12 at 13:15anchor=north,at={(axis description cs:0.5,-0.18)},. The-0.18should suffice for the y-offset due to thexlabel, at least it does in my case. I'd also recommend to use multiple legend columns withlegend columns={..insert number here}then. – henry Jun 24 '14 at 14:01legend to nameand referring to it directly after the picture. – Paul Paulsen Jan 30 '15 at 13:06