To place the wrap figure at the right , you have to use r not l. Another fact is that it should have enough text in the surrounding so as to wrap properly. If you want to force the placement *exactly here you can use the capital R (or L, I, or O). Fot details see the documentation of wrapfigure. (texdoc wrapfig). Here is a complete MWE:
\documentclass{article}
\usepackage{graphicx,wrapfig,lipsum}
%------------------------------------------
\begin{document}
This is where the figure goes with text wrapping around it. There should be enough text around the wrapfigure so that it is warpped properly.
%------------------------------------------
\begin{wrapfigure}{r}{6cm}
\includegraphics[width=6cm]{example-image-a}
\caption{A wrapped figure going nicely inside the text.}\label{wrap-fig:1}
\end{wrapfigure}
%------------------------------------------
\lipsum[3]
\par
Figure~\ref{wrap-fig:1} is a wrapped figure. \lipsum[4]
%------------------------------------------
\begin{wrapfigure}{R}{6cm}
\includegraphics[width=6cm]{example-image-a}
\caption{A wrapped figure going nicely inside the text.}\label{wrap-fig:1}
\end{wrapfigure}
%------------------------------------------
\lipsum[5]
%------------------------------------------
\end{document}

ltor. Also what is the purpose of\hrulefill? – Harish Kumar May 13 '12 at 11:33