There is no magic number. USCIS can move to take away your green card if at any time they believe you to have abandoned your permanent residence in the U.S. Best to apply for a re-entry permit before you leave to protect your permanent residence status.