The term "expatriate" (or "expat" for short) is often used to refer to individuals who temporarily live in a foreign country for professional or personal reasons, but have the intention to return to their home country at some point. Expatriates typically have temporary legal status in the host country, such as a work permit or temporary residence visa.
On the other hand, the term "immigrant" usually refers to a person who settles in a foreign country with the intention of living there permanently. Immigrants traditionally intend to establish themselves in their new country for an indefinite or permanent period, and often seek permanent residence status or citizenship.
In summary, the main difference between an expatriate and an immigrant is the intention to settle in the host country temporarily or permanently. Expatriates often have a temporary intention, while immigrants have a permanent intention to establish themselves in their new country.