Replace the cassette when a new chain skips on it under load, and replace chainrings when the teeth are hooked like shark fins or hold on to the chain. Replacing the chain on time is what makes both last.
The practical test for a cassette or chainring is how it runs with a new chain. A worn chain measures longer between pins, rides higher on the teeth and reshapes them to its own stretched length. Fit a new chain to those teeth and it cannot seat properly, so it slips forward when you push hard. Park Tool states the cause plainly: using a chain beyond its wear limit prematurely wears out the cogs and chainrings.
Park Tool's general replacement limits for a chain are 0.5% elongation for 11-speed and above, 0.75% for 10-speed and below, and 1% for single-speed. Makers differ: SRAM's support site gives 0.8% on an approved checker for its RED AXS chain, so check your manufacturer's figure. A chain taken off at its limit leaves the teeth close to their original shape, and the cassette carries on with the next chain. A chain run well past the limit usually takes the cassette with it, and sometimes the chainrings.
On a bike with two or three chainrings, the cassette usually goes first. Its cogs are small, so each tooth meets the chain more often, while a large ring spreads the load across many teeth. A single-ring drivetrain changes that. One ring, often aluminum, does all the work, and it can wear out as soon as the steel cassette behind it. Whichever part you replace, fit a new chain with it.
A mid-drive motor sends its torque through the chain, the cassette and the chainring along with yours, so all three wear faster than on an unassisted bike. A hub motor drives the wheel directly and adds no load to the chain. Some parts are built for the extra torque: Shimano says its LINKGLIDE cassettes are up to three times as durable as its HYPERGLIDE cassettes under high chain tension. Ask a shop about compatibility before mixing parts.
Where Saddle fits. When a Saddle shop replaces a chain, cassette or chainrings, the completed job is written to the bike as a signed service record. The next mechanic can see when each part was last changed, and so can the next owner, while the shop's prices and notes stay private to that shop.
The intelligence layer behind bicycle ownership.