Ok, so I just returned from a trip where I flew in and out of Madrid and took the train to/from Seville.. This is my recommendation and observations..
1) I'm ok with buying the train ticket ahead of time before arriving into spain. However just buffer yourself. For example I had a flight which was scheduled to arrive at 8 AM. Unfortunately it was two hours late. Luckily I bought my tickets for 12:00 and it worked out. So if you do just add extra time.
2) I'm pretty good with airports but finding the right express train at the airport in Madrid is a challenge. In T4 (the international terminal) when you exit there is the metro and then there is the express trains that are part of the RENFE railroad. When you get down there it is pretty confusing as to which kiosks to use and there isn't much english. and contrary to what I read on the internet there was no one to help.
3) Note that if you buy a RENFE ticket, you are entitled to free transfer to/from the airport to the train station. YOu have to find the correct kiosk and then the button (no english) that says "combinado cercanias" which I think means free transfer. At the kiosk there is a little camera and it scans the barcode on your RENFE ticket. If all goes well the kiosk will spit out a ticket for you. This gets you in and out of the the express train system.
After you get on the express train, DO NOT and I repeat DO not lose your ticket as you need it to exit later on.
4) So once you get to the RENFE express train you will end up down on a train platform. There are different trains and it is difficult to figure out which one to use. You only want the C1 Line. You are at the end of the line, so luckily you don't have to worry about going in the correct direction.
5) It takes about 25 minutes to get to the Atocha train station. There are several stops so pay attention.
6) When you get to Atocha it gets a little confusing. YOu exit the RENFE express area (use your ticket) next you have to go and find the correct RENFE train depending on where you are going to go. You will see a lot of confused people here.
There are a couple of different levels and it isn't really obvious the first time where to go. Most of the AVE trains to seville and cordoba are up a level. I didn't quite figure the logic of it out.. So what you need to do is look for the electronic boards and find your train number and the track. Note the track number isn't displayed until about 20 minutes before the train leaves so you have to wait around. Note if you buy a first class ticket you can find the lounge and wait in there.. I like the first class coach as it is more quiet and often half empty and really not that much more expensive.
7) Bottom line, the first time it probably took me about 1:30 minutes from the time I exited customs until I figured out where to be at Atocha. But it easily could have been longer as the express train from madrid runs on a 30 minute interval and I caught it right as it was leaving.
If I had it to do again of course It would be much faster. I could probably make it in 45 minutes.
So if you are running late the first time, taking a taxi might be a good option otherwise figure on at least an hour and a half,, more if you are the type that gets lost a lot. Better yet if you get lost a lot I recommend just grabbing a taxi.
8) On my return getting from Atocha to Madrid was also a little confusing as there are a number of express RENFE trains leaving from Atocha, only one goes to the Airport (C1). So you need to make sure you get on the C1 and not the C2,3,4 which won't get you to the airport. ALso note you need to figure out the correct direction to go. (the direction on the train is indicated by the end of the line)..
Again time is your friend and learn how to read the train schedules.