Number of cogs
This field gives the number of speeds (cogs) on the cassette. Most common are 8,9,10,11 cogs. The number of cogs determines what width of chain you need. A 7 or 8 speed are the same chain. Above that, you should get a chain for the specific number of cogs. Eg: 9 cogs requires a 9 speed chain, 10 cogs requires a 10 speed chain, and so on. Normally you would replace your cassette with one with the same number of cogs. That way you won't have any issues with your indexed shift lever, or with the freehub width.
Changing the number of cogs:
It is possible to switch to use a different number of cogs. It is easiest if you are using friction shifters. In this case, all you need to ensure is that your Freehub (onto which the cassette slides) is the correct width. You also need to consider chain width, and indexed shifter width.
To go from 7 speeds to 8, they made the chain slightly narrower (7.3mm to 7.1mm). But you could still use one of these 7-8 speed chains with any cassette. The table below shows how the sprockets get thinner as you increase the number of cogs.
Speeds Sprocket TotalFreehub: As you know, the cassette slides onto the freehub body. The same freehub width is used for 8/9/10 speeds - all they did was make the cogs narrower. You can also put 7 speed cassettes onto these hubs, but you need a spacer. I have done this on several of my bikes. See https://www.sheldonbrown.com/cribsheet-spacing.html
Thickness Width ------------------------------------------
5 2.0 24.0 //this is a freewheel not a cassette
7 1.85 31.9
8 1.80 35.4
9 1.78 36.5
10 1.6 37.2
The largest cog for 7 speed is 34 teeth but they are not as easy to find as the 11-32 cassettes. Largest on an 8 speed is 34, but more commonly available are the 11-32 teeth. The largest cog on a 9 speed is the new highly desirable HG50 (11-36), and 12-36. The largest cog on a stock 10 speed cassette is 36 teeth. (11-36) It is only when you get to 11 speed that you get the really huge back cogs like 42 teeth, intended for 1x mountain bikes. 11 speeds is a different freehub and a specialized chain. Not recommended.