Gauge is determined by a knitter or crocheter making a sample piece called a swatch with the yarn they intend to use for a specific project. They then use the swatch to check their gauge and make adjustments as necessary.
Needle crafters can find gauge swatch rulers and other notions necessary to measure their gauge at Yarned and Dangerous.