A distributor cap and rotor should go at least 60,000 miles or even more before needing replaced but they don't cost too much and it doesn't hurt to have the distributor cap and rotor replaced when you go for a tuneup or when you do a tuneup on the vehicle yourself.
Depending on the vehicle make and model a distributor cap and rotor together costs around $30.00 so it's a cheap thing to replace and will help improve your gas mileage and performance when you replace the distributor cap and rotor.