Alternatively, you can take the bus.
http://www.emtmadrid.es/lineaaeropuerto/index.html They claim it takes 40 minutes on average to get to Atocha (from T4 - should be less from T2).
For a taxi it should be less of course.
If you already have your Renfe tickets, you'll only have to go through a quick security check (only your bags go through an X-ray) and an equally quick control of your tickets before boarding the train. I usually try to be at the station at least 15 minutes before departure.