Upvote:2
You have plenty of time to enjoy the city.
From the airport, take the train to the Central Station (travel time - maximum 30 minutes); if you take the express train you can get there in 15 minutes.
The trick is (as others mentioned) to buy the ticket in advance although I have never had to wait long at the airport "mall" where the yellow ticket machines are. If they are full or not functioning, there is a large bank of ticket agents just behind the machines that can help you out.
Once you reach the station and depart; here are the things you can do within minimal walking distance:
You can easily whittle away 6 hours just by walking around. Be mindful that you will need at least 30 minutes (assuming the trains aren't late or aren't switched at the last minute) to get back to the airport, and then an extra 45 minutes to pass through security + customs. These lines can get quite long (especially the security check).
Unless you plan in advance by buying the museum tickets online - I would not risk a trip to the museum; I personally hate being rushed back to the airport as there are too many variables that can make you miss your flight.
Upvote:5
I will argue against the comments: that's entirely doable. There is a good train connection from the airport to the city and it drops you off in one of the more interesting areas. See http://www.amsterdam.info/airport/ . While the train is quick and frequent, the lines in front of the ticket machines can be quite long, so I'd recommend buying the tickets upfront online.
There is a lot of stores, coffee shops (i.e. weed) and canals in easy walking distance. Even the bicycle parking garages and barges around the train station are fun to see. And yes, the working girls are around there as well. Some of the nicer museums (van Gogh, Rijksmusuem) are a little further and would probably warrant a taxi ride.