You should renew your Permanent resident card (green card) valid for 10 year that has either expired or will expire. You may file this petition 6 months before your permanent resident card expires.
IF you have a conditional green card that is valid only for 2 years. You will need to file a petition to remove the conditions of your residence before the card expires. You may file this petition 90 days before your card expires.