Not exceeding 6 months when you are not in USA should be acceptable. It depends on how your green card is administrated, if through h1-b or O1 then a couple of years. Marriage with a person who is in the process of application before the green card is issued then it might be days or a few months.