Headspace is the space between the cartridge head and the breech face, when the gun is closed.
The gap should be no more than a few thousandths of an inch, otherwise you may suffer from excessive recoil, among other problems.
Headspace gauges are usually used for checking. They come in pairs – a ‘go’ gauge and a ‘no go’ gauge.
When they are inserted in the chamber, the gun should close over the ‘go’ gauge, but not over the ‘no go’.
The usual difference between the gauges is only a few thousandths of an inch, although with rimmed ammunition such as a shotgun cartridge it’s always a bit theoretical as the headspace depends on the thickness and profile of the rim, which can vary from one cartridge manufacturer to another.
If the space is excessive, the usual solution is to re-joint the gun.
In fact, excessive headspace can be a symptom of worn jointing, and the inverse can be true too: excessive headspace can cause jointing to wear prematurely.