EDIT: this answer uses an extreme example, perhaps irresponsible, I admit, but which tried to state some things which I think are valid considerations regarding the question asked:
- Sprockets can be used for very long provided you change the chain frequently; That COULD mean there are a lot of usable cassettes being thrown away that could still give more kilometers per buck if properly managed;
- Replacing a sprocket is necessary more because of safety than because it doesn't work anymore, or because it could damage other components (the example shown crossed the safety issue while still working fine);
- There is a limit to how worn a sprocket can be even if it still works. The photo shown is an extreme example (caricatural, in a way). Thanks to the fruitful discussion (see comments), I could not feel like advising anyone to use any sprocket to the point the one I show in this photo. Anyone doing this would be at his own risk, and that is Bad Thing. It shouldn't be done.
I hadn't, and would not recommend, to measure the wear on the cassette, but on the chain.
If you put a new chain with a cassette, and it doesn't skip, the cassette is ok, even if the teeth are a bit thinner than new. That is possible if you change the chain often, always for a new one: then the cassette wears out slowly, but the teeth are never deformed like a ramp (shark teeth). I elaborated a lot on this in another answer: http://bicycles.stackexchange.com/a/7880/2355https://bicycles.stackexchange.com/a/7880/2355
Of course, when the teeth are SO THIN that they are pointy, or its width is significantly reduced, perhaps it's time to convert the cassette into a set of ninja shuriken (just kidding).
There could be problems with the indexing of gears if you are a fan of ultra-precise shifting, but that usually is not a great problem, and as far as I know don't cause damage to other parts of the shifting system, at least if it is not necessary to force the lever to shift up (could stress the pulleys - usually this is not the case).
At last, the proper way to measure for the CHAIN wear is the distance between pins, that should be exactely half an inch for each consecutive pair of pins. This can be measured in two ways:
- With a chain wear measuring gauge/rule. This is very easy and precise.
- With a regular ruler. You must measure one foot of chain (12 pairs of links) while it is slightly under tension. If the distance increased by more than the thickness of a pin, then it's time to replace it.
Just for the record, this is a current picture of my internal-gear-hub bike with surely more than 25 thousand kilometers with the original cog. I must have used some eight chains on it, always replacing via measuring, either with a gauge or with a ruler. It works without issues (no skipping, no falling off, no grinding sensation). This is too much, I recommend not going so far. I has paid itself a long long time ago.