How long to stay after immigration card is issued

I have been told by immigration to wait 30 days to leave mexico. An acquaintance told me I don't have to wait at all and can leave immediately. Does anyone know answer? I'm in cancun.

I got my Permanente on the last week of July and left for the US the first week of August.