People who have been living in the U.S. illegally for over a year and then leave the country can seek legal residency if they don't re-enter the U.S. for at least 10 years. However, many people have family obligations in this country that would make deportation and a decade-long re-entry ban very difficult for their loved ones.
For immigrants whose deportation would impose an extreme hardship on their immediate family, the U.S. Citizenship and Immigration Services (USCIS) offers a "601 waiver." If granted, this allows people time to adjust their immigration status without facing deportation or to re-enter the country if they've been gone for less than 10 years.