Trains between Madrid and Toledo use the lower level at Atocha; trains between Madrid and Barcelona use the upper level; I don't know which level the Seville trains use.
If you arrive and depart from the same level at Atocha, 15 minutes between is plenty. You'll just go from the train into the departure lounge, then back out again as soon as your new track is posted. If you arrive and depart from different levels (I did, since I came from Toledo and went to Barcelona), use the elevator that connects the departure lounges. This way, you not only don't have to find your way through the large and confusing station, you don't have to go through security again, so this saves a LOT of time. The elevator is outside, in the track area, near the high-number tracks; ask for it if you have any trouble finding it.
Using this elevator, I had 30 minutes to make my connection, and still had time to kill.
I had to buy my tickets in two segments. When I looked on Renfe, it only showed two connections from Toledo to Barcelona all day. I used Bahn to find all my options, then booked it as two tickets on Renfe. When booking on Renfe, use Paypal, since US credit cards rarely work (mine didn't), whereas Paypal goes right through.
This TripAdvisor tutorial was invaluable in knowing how to use the Renfe website: https://www.tripadvisor.com/Travel-g187514-c80518/Madrid:Spain:Buying.Renfe.Tickets.Online.html
In the end, it took me five websites to book these tickets (Renfe, Bahn, Paypal, TripAdvisor - and Rick Steves to learn about the others!). But in the end, it worked fine.