Toledo is one of my favorite places. You can see a lot in a day, but I spent three nights there so I could take my time. The tourist office sells a wristband that provides entry to 6 or 7 "secondary sights" that I really enjoyed. A short tour is included at most of those sights if you can time it right; be sure you have access to an electronic map to find your way quickly between sights if you want to catch the tours--it is challenging if you have only a paper map.
There are many lovely buildings to see in Toledo--many designed in mudejar style. I think you will really love the city, especially since you will not have time on this trip to go down to Andalucía. Get an early start and plan to stay the full day. It's hilly, and the historic area is quite large. Do buy your return train ticket on your way out of Madrid; Rick reports that the last train(s) back sometimes sell out. In a pinch, there is also bus service, but it takes longer and you will end up at a satellite bus station rather than Atocha.
Segovia can also be reached on a day-trip. I didn't go inside the Alcazar, but I'm sure it's a worthwhile visit. The aqueduct is unbelievably stunning. I spotted one or two old churches, but they had not been restored and one could not go inside them as of last year.
You can look up the train schedules on the Renfe website. Be sure to use the correct day of the week; that can matter.
One reason to spend a lot of time in Madrid is the three great art museums. If you have no interest in those and only want to make two day-trips out of the city, I think 4 days in Madrid and 5 in Lisbon would be fine--especially if you begin your trip in Lisbon. Day 1 is very often experienced in a jetlagged fog.
If you have extra time in Madrid, I thought the nearby university town of Alcala de Henares was very pretty. I don't know that it has any major monuments, though. There's also the Palacio Real in Madrid itself. A major sight for many travelers, but visiting it just confirmed that I do not like most palaces.