It is forbidden to leave Eretz Yisrael for the Diaspora at all times except:
to study Torah;
to marry; or
to save one's property from the gentiles.
After accomplishing these objectives, one must return to Eretz Yisrael.
Similarly, one may leave Eretz Yisrael to conduct commercial enterprises. However, it is forbidden to leave with the intent of settling permanently in the Diaspora unless the famine in Eretz Yisrael is so severe that a dinar's worth of wheat is sold at two dinarim.
When do these conditions apply? When one possesses financial resources and food is expensive. However, if food is inexpensive, but a person cannot find financial resources or employment and has no money available, he may leave and go to any place where he can find relief.
Though it is permitted to leave Eretz Yisrael under these circumstances, it is not pious behavior. Behold, Machlon and Kilyon were two of the great men of the generation and they left Eretz Yisrael only out of great distress. Nevertheless, they were found worthy of death by God.