PB;
May I recommend you find a basic descriptive site that explains shotguns? Or a basic book like the NRA's The Basics of Shotgun Shooting (really thin paperback w/lots of big pictures) -- this is used in the NRA Basic class which I'd recommend.
SHotguns are a different animal. Maybe the exact opposit of a rifle in many respects, but more versatile. I think people here presumed you were more familiar w/them. Barrel length has little to do with things in most respects. Cartridge selection including shot size and choke are much more important.
"Choke" is the funnel at the muzzle. Different, standard named, chokes that constrict the inner diameter of the barrel at the muzzle, can often be replaced just by screwing one size out and another in. They taper in the muzzle and focus the shot into certain size patterns. Its kinda like turning the end of a garden hose -- the spray will become wider or narrower, and go further or not, depending on where you set it. A rule of thumb is that the optimal shot pattern is defined as where 70-75% of the pellets are within a 30" circle and different chokes produce that at different distances (slightly affected by the size of the shot and the pecularities of the shells used). For example, an Improved Modified (which is less common than some others) will give you that 30" pattern with # 7 1/2 shot at approximately 35 yards.
My personal opinion is that as shot size grows to heavy buckshot, and the choke constricts more and more, optimal range eventually meets the effective range of a shotgun at around 50 yards. The maximum range is somewhat further.
Al