If you’ve got a shorter layover, you need to decide if journeying beyond the airport is worth your time. In general, leaving the airport requires a layover of at least 9 hours, but the minimum time varies by airport. Here are some things to think about when deciding the minimum time you need for a layover.
Deplaning and going through immigration could take up to two hours, especially in the busiest hubs. In general, you'll need to go through immigration any time you land in a new country, though there are some exceptions, such as when you're travelling within the Schengen Area.
You’ll need to figure out ahead of time how easy it is to get from the airport into the city. Cities with excellent transit systems (like Amsterdam and London) make it easy to get back and forth, but if there’s no rail system available, you’ll need to check for traffic delays.
Allow yourself at least 2-3 hours before departure back at the airport to recheck your luggage (if necessary), get through security, and find your gate.