You can leave the airport during a layover, but honestly I would not for only 9 hours.
The 9 hours is the time between your plane's arrival and takeoff of your next flight. Remember that it will take some time to deboard and you have to be there early to board the next plane. If you leave the airport, you will have to go through Customs and Immigration and that will take some time, and then you have to go through security again when you come back which will take more time.
Say that all of that adds up to only 2 hours, so that you still have 7 hours. You have to add in the transportation time to and from the hotel as well as time for the check in and check out process.
Most airports have somewhere you can sleep- a lounge, rooms you can rent, a hotel within the airport. You can also pass time in the shops, reading, people watching, etc. I would just do this instead of leaving the airport.