It's recommended you replace the brake pads every 20,000 to 40,000 miles depending on how much you use the brakes.
Brake rotors should be replaced every 50,000 to 80,000 or even 100,000 miles depending on how often you use the brakes as well.
Usually you can replace just the brake pads and then every other brake pad change you may need to replace the brake rotors.
Sometimes you may need to replace both brake rotors and brake pads at the same time but most times you just need to replace the brake pads and don't always have to replace the brake rotors unless they're warped, grooved really bad or damaged in any way or getting really thin.