For most layovers, you can leave the transit area (and airport) in between flights, as long as you have a visa (if necessary) and go through customs and immigration on the way out, and of course you'll have to pass through security again on your way back into the airport.