In general, the United States has no exit controls. Therefore, when you leave the US, there are no checks for how long you have stayed and whether you have exceeded the 90-day maximum stay allowed under the Visa Waiver Program. The enforcement rationale seems to be that even if you have broken the law and overstayed, you're leaving the country anyway so there's no point in seeking to punish you (and the punishment would likely be deportation).
However, if you depart the United States by air, your airline electronically notifies US Customs and Border Protection (CBP
) of your date of departure. In this way, CBP
will know how long you have stayed in the US. While an overstay is usually not a problem when leaving the US, it WILL certainly be a problem when you next enter. The overstay will flash up on your record with CBP
and the officer will not be happy. You will likely be arrested and jailed or deported on the next flight to your home country. You can also forget about ever getting ESTA approval again, you will have to apply for a visa each time you want to visit the US again.
If you leave the US by one of the land borders, CBP
isn't notified of your departure like if you leave by air. However, they can probably still work out how long you stayed, for example by comparing the date of your US entry stamp against the entry record for the next country you entered.