This could depend on which airport. This article is a humorous explanation of the time you need to get to various areas and what the airports are closest to. Chances are, you could logistically make it happen, particularly if you choose one thing that you plan to do, but you'd have to decide if it's worth it.
I've done a long layover (about 10 hours) in Atlanta with my husband coming back from Spain; we had time to go eat dinner with some family members and then come back; this one felt worth it. My husband recently chose an itinerary with a long layover at CDG because he wanted to make a quick trip into Paris to see the Atelier des Lumières. He was able to do it, but felt stressed about getting back on time, then got back too early and still ended up waiting around bored. My own personal preference is to do that kind of thing on the way back home, when it's not so big of a deal if something goes wrong.