You need to allow at least 2 hours for getting from the gate to the terminal concourse and back again. Terminals 1,2,3 within walking distance (same building) and share transport connections. Terminal 4 is separate, with a different metro station. It's also big (with some gates connected by underground monorail) so it takes a bit longer to get from concourse to gate than the others, and it's further from town. The advantage of terminal 4 is it has a local railway (cercanias) connection which the others dont, but it only runs every half hour.
So you have about 2.5 hours which is rapidly eaten up by travelling to the centre. You probably have enough time to physically get to most landmarks in Madrid, but maybe not to really enjoy them.
Another issue is that single Metro tickets cost about 1.50 euros but there is now a 3 euro supplement each way on Metro tickets at the airport station, which means a return trip costs about as much as the 8.40 euro 1-day tourist pass (which doesn't require the supplement.) There are some local buses from the airport that don't require the supplement, but they offer a less direct route to town.
This true-scale map (from the official site) is displayed in all metro stations:
https://www.metromadrid.es/export/sites/metro/comun/documentos/planos/Planobasecartografica.pdf
I would suggest the following:
Retiro park, as mentioned by Ivana
Santiago Bernabeu Stadium, if you like soccer (Real Madrid). Just take the pink line from the airport to the end at Nuevos Ministerios, then walk to the stadium, or take the blue line one stop.
Sol (not because I recommend it but because it's famous as km 0 in Spain) and the royal palace / cathedral which are within walking distance and have nice gardens in front. From there you can walk to Plaza de España station, which is well connected to the airport on the dark blue line 10, changing to the pink line at Nuevos Ministerios.
Near terminal 1,2,3 there is a nice park called El Capricho that it is reachable by bus and is only about 25 minutes away.
General Madrid advice: be wary of pickpockets. It's a great city, I spent 6 years there, I hope you enjoy it!