Expat literally means "living outside of your homeland". So by definition an immigrant is an expat, but an expat is not necessarily an immigrant. Sometimes expat is used in a stricter sense (also called "true expat") to refer to people sent abroad by their employer on usually very very favorable packages (the "expat packages"): everything paid (rent in prime neighborhoods, private schools for kids, plane tickets to visit home, etc.), on top of an indemnity for living abroad, on top of the regular salary paid home.
In my case I was an expat in the United States (only went there to work, no intention to stay), but then I immigrated to Japan (now a permanent resident, no intention to leave). It would have been wrong to call me an immigrant in the US, but I am both an expat and an immigrant in Japan.