The simple answer is when it is worn out. Worn-out drivetrains will shift poorly and won't perform nearly as well as a fresh drivetrain. Luckily, you don't need to replace your entire drivetrain all at once, with some components like your chain wearing out faster than components like your chainrings or cassette. Some tools can help you determine if your chain, cassette, or chainrings are worn out.