If you are an international student from Jamaica in Canada and you book a connecting flight stopping in the USA, can you leave the airport if there is a 20-hour layover?
Every passenger on an international flight arriving in the US must pass through immigration and customs. After customs you will be in the arrivals area of the airport, and from there you're free to go wherever you want.
Eventually, if you want to catch your onward flight, you'll have to drop your checked bags (if any) off and pass through departure security -- but nobody cares whether you do that immediately, or after going somewhere else, or not at all. (The airline will care if you don't take the connecting flight at all, but the worst they'll do if that happens is cancel your return tickets, if any).
The flip side of this is that you need a visa that allows you to enter the Uniteds States even if you intend to sit around in the airport for the entire layover. You can't choose not to enter the US.