How long can I ride my bike with a worn cassette?
In my experience, skipping in certain gears at the rear is the first sign.
Usually in the most used sprocket.

Then the chain becomes worn - and perhaps starts to snap - and when you order a replacement - it skips all over the place because it is being run on an overly worn drive-train. You might be able to salvage the old chain and run it for a bit longer - but sooner or later - you have to bite-the-bullet and buy complete new drive-train.

But if your current drive-train is happy and not exhibiting any malfunction (keep that chain clean and oiled) - you could go for many many many miles on it.