it depends on how you get the green card.
If by marrying to a citizen, you have to stay married for two year before removing the condition on your green card.
If you get GC together with your spouse through EB or FB, you could keep your green card after divorce