Replace parts? As often as they wear out. As a rule of thumb I expect to replace chains and tires around 2,000 miles. Broke a seatpost around 60,000 miles. Those seem to be the extremes (so far).
Cables and housing are an exception, usually once a year. Bar tape gets replaced at the same time.