How worn does a rear sprocket have to be before you replace it? To help you judge, here are photos of a rear sprocket that had done 25,000 km laid over a new one.
The bike is a 2012 BMW G650GS, and I also changed the gearing from the standard 47T rear to a 44T. Some of this is specific to the bike, but the way tooth wear shows up is common to any chain-driven motorcycle.
Hello everyone, Boo here.
Wear on a rear sprocket after 25,000 km

This is how worn the old sprocket was.
It looks fairly worn to me.
The old sprocket had done about 25,000 km.
Between 21,000 and 25,000 km, I lubricated the chain every 200 to 300 km.
Here's how I lubricate the chain:
Laying it over a new sprocket

I laid one over the other so the wear is easier to see.
I don't know what the old sprocket looked like when it was new, but next to the new one, its teeth look a lot more pointed.
As this compares a 47T with a 44T, the outside diameters can't be compared directly. What you can compare is the shape of each individual tooth.
Seeing how pointed the teeth had become is what made me decide to replace it.
From the standard 47T down to 44T

So, this is the new sprocket.
It's made by Esjot, a German manufacturer. Apparently it's machined using their 'Diamond Cut' process.
On its official website, Esjot describes its Diamond Cut machining process and states a radial and axial runout tolerance of under 0.2 mm for its rear sprockets (Esjot official website).

This sprocket is 44T. The standard one is 47T, but I went for fewer teeth to make the gearing taller.

Here's the 47T next to the 44T.
The difference in diameter was bigger than I expected. I was a little worried whether it would be all right.
Going from 47T to 44T is about 6.4% fewer teeth. At the same road speed, engine revs in a given gear drop by that much; at the same revs, road speed goes up.
How did it ride on 44T?
I've written up how the bike rode after the sprocket change in this post:
Replacing the rear sprocket on a G650GS

On the G650GS, the sprocket carrier can be removed from the wheel.
The tool you need: 13 mm

The sprocket bolts are 13 mm.

The nuts on the sprocket bolts are 13 mm too.
The spanner I'm using is a Stahlwille.
I came across it by chance in a second-hand tool shop and bought it.
It feels as if it really bites onto bolts and nuts.

Here are the removed sprocket, the bolts and the tools I used.
Rusty bolts on an 11-year-old bike

Some of the bolts I removed were rusty and some weren't.
This bike is a 2012 model, so it's about 11 years old.
Regardless of mileage, this may be something worth checking on an older bike.

Here's a close-up of a rusty bolt.
I was tempted to replace the bolts, but I decided to remove the rust and reuse them.
Removing the rust and refitting

So, I removed the rust from the bolts and refitted them.
For strength, though, I think fitting new bolts would be the better choice.
To remove the rust, I used Hanasaka G Rust Remover, a Japanese rust remover.
I've written more about it in a separate post (in Japanese).
Torque and marking the bolts once tightened

I tightened them with a torque wrench to the torque given in the repair manual.
Please check your own bike's repair manual for the specified torque.

When working on a bike, it's easy to lose track of which screws and bolts you've already torqued, so I mark every bolt and nut I've tightened to the specified torque with a Sakura paint marker.
And with that, the rear sprocket change was finally done.
What about the front sprocket and chain?
Without proper maintenance, a chain can run dry, wear the sprockets, hurt fuel economy and even come off while riding. The basic rule is to replace the front sprocket, rear sprocket and chain together as a set.
In fact, the reason I had looked into changing the front sprocket earlier was that I really wanted to change the rear one (that post is in Japanese).
On this job I replaced the front sprocket and the chain with new ones at the same time.
Running new sprockets with a stretched chain makes the sprockets wear faster, and the same goes for the front sprocket. That's why I replaced all three together.
Summary
Laid over a new one, the rear sprocket that had done 25,000 km showed a clear difference in tooth shape. On the G650GS the sprocket carrier comes off the wheel, and the sprocket bolts and nuts are both 13 mm. On my 2012 bike, some of the bolts had rusted. Even on a low-mileage bike, it's worth checking on an older machine.