Besides your tires, your bike's chain is arguably the component that needs most frequent replacing. Wait too long, and your chain will wear out, diminishing shifting quality and shortening the lifespan of your drivetrain.
So how often should you replace your chain? Before answering that question, it helps to understand the process of chain wear. As your chain ages, each link's internal bushings slowly lengthen. In turn, your now-longer chain puts added pressure on your cassette cogs and chainring teeth, causing them to wear faster. This also hampers shifting quality.
To avoid this accelerated wear of your cassette and chainrings, a general rule of thumb is to replace your bike's chain every 2000 miles. Just know that this is just a starting point, and that no two chains will wear at exactly the same rate because no two riders treat their chains the same.
If you're the type who spins easy gears, meticulously cleans and lubes your chain after every ride, never rides in the rain, and weigh as much as a Spanish WorldTour climbing specialist, your chain is likely to last longer than 2000 miles. But if you never miss a meal, love to push big gears, ride rain or shine all time, and don't even own shop rags, getting 2000 miles out of your chain is likely a pipedream.
These differences in riding style are why it's best to use a chain wear measuring tools such as the Park Tool Chain Wear Indicator to find out the condition of your chain. With tool in hand, apply pressure to a pedal so the top of the chain is taut, and then place the measuring tool in place and read the results. Indicators on the tool will tell you whether or not it's time to replace your chain.
You can also measure chain wear using a standard ruler. To do this, first remember that all modern chains have rivets every half inch, and that you will be measuring from one rivet to another one that is 12 inches away.
Again start by drawing the chain taut. Then align the end of the ruler at the zero-inch mark with the center of a rivet and see where the ruler's 12-inch mark lines up. If it's dead center on a rivet, the chain is in like-new condition. If the rivet is less than a 1/16 of an inch ahead of the 12-inch mark, then the chain is showing some wear but is still rideable. If the rivet is more than 1/16 of an inch ahead of the 12-inch mark, it's time to replace the chain.