Shotgun sizes have always been measured in a somewhat roundabout way. You would think that the "12" in a 12-gauge shotgun corresponds to some linear measurement -- maybe inches or centimeters. But that's not the case. "12-gauge" means you can make 12 lead balls, each of equal diameter to the gun barrel, out of 1 pound of lead. This originated in the days when you would buy lead by the pound to make your own ammo. The gauge told you how many rounds you could make for the gun from 1 pound of lead.
The smaller the gauge number, the wider the barrel. The largest shotgun is a 4-gauge. The .410 shotgun, the smallest, is an exception to the rule: It's actually a .410-caliber -- it has a .41-inch barrel diameter.
In general, the smaller the barrel diameter, the less "kick" or recoil the shooter feels from the gun. Many experts say that a 20-gauge shotgun is a good beginner's gun because it has relatively little recoil but fires more shot per shell than the smaller-diameter .410-caliber.