We were just there. I bought the premium tickets that permit unlimited changes. Lesser price tickets on RENFE will permit maybe 1 or 2 changes--look at the descriptions and rules.
The train from Madrid airport (at least the one we were on) required a change of trains at another station to continue on to Atocha.
That added about 15 minutes to the journey. It took us about 45 minutes to get from the Airport to Atocha.
We did carry on and didn't have to go through Passport control as we came in from Switzerland instead of JFK. This also put us in terminal 4 where the trains leave.
Thankfully we had tickets we could change because we ended up missing 4 planes to Madrid. The last ticket I reserved was 4 hours after we were to land, just to be sure. it was easy peasy to go to the RENFE office (near the atrium) at Atocha and change the tickets to an earlier train.
Bottom line-- if your plane is on time you should have time to get the 5:03. BTW: our train ticket from the airport to Atocha was included in the price of our ticket. we just scanned the barcode and away we went.