If you are caught in Mexico as an illegal immigrant from America, you get 2 years in prison.
All you need to do is cross back to the states once in a while to keep from being deported.
I never heard of any American being jailed for it.
They need the American money too much to enforce the law.
Besides, all cops in Mexico take bribes.