The biggest repair costs are going to be replacing the main battery pack and motor(s). It's not so much the labor cost, but the cost of the parts. Motors and main batteries cost 5k-10k+. That's if you buy new. if you buy used you can obviously save a lot of money depending on where you get the part from. We recently replaced a motor for a customer and we charged about $4k for the motor and labor.
While the motor can and will have catastrophic failure, the battery is likely to just slowly degrade over time. You will get less and less range as the battery degrades. You'll still be able to drive the car, but instead of getting 250 miles, you may only get 230 or 220 miles. My 2012 is on the original battery and I'm still able to get 220 miles on a full charge, down from 250.
The battery and motor are going to be the biggest repair costs, so if you are buying an older used model S, make sure to ask the seller if they have ever had either of those replaced by Tesla. If they just had it replaced a year or two ago, you should be good for a while. You should also ask how many miles it gets on a full charge, and you might even want to see it at full charge to verify. Also, if the car is a 2013 or newer, it may still have some battery/motor warranty left.
Beyond the battery and motor, which are not common problems we see customers in for, there's also the MCU, door handles, window regulators, leaky screens, and failing control arms. These are the most common problems we see, and they can each be fixed for under a grand by us for anyone that wants to come to our shop in SoCal. Door handles and window regulators are the most common and we fix those for $140-170 for door handles and $250 for window regulators.
It all depends on the car and luck too. For my personal car that I've owned for a year and a half, I haven't had to fix any of these problems. The only thing I'm going to do now is fix the inner tire wear problem common on Model S and X cars with air suspension. Don from N2itive
N2itive Launches Rear Control Arms for Tesla Models S/X! has developed a fantastic product that we are now stocking that will allow the cars camber to be adjusted so that the inner tires don't wear down much faster than the rest of the tire. We are currently running a special for all 4 rear camber and toe arms to be installed for $1650. That's over $850 off the full retail price!