If you need to remain outside the U.S. for an extended period of time, it is advisable to apply for a re-entry permit before departing the U.S. You can only apply for a re-entry permit from inside the U.S. A re-entry permit is a travel document issued by USCIS that allows you to remain outside the United States for up to 2 years; this period is shortened for conditional residents and lawful permanent residents who have already been granted multiple re-entry permits. If you need to remain outside the United States for more than 2 years, you will need to return to the United States prior to the expiration of your current re-entry permit to apply for a new one. While a re-entry permit does not guarantee entry, it is evidence of your intent to live in the United States permanently. It is important that you continue to maintain ties to the United States and make sure your travel is temporary in nature.
A re-entry permit may also be used as a travel document if you are unable to get a passport from your home country. Many, but not all, countries will let you use a re-entry permit like a passport. You will need to check whether the country you wish to visit will accept a U.S. re-entry permit in lieu of a passport.