The United States legal code USC 18 defines the shotgun as "a weapon designed or redesigned, made or remade, and intended to be fired from the shoulder and designed or redesigned and made or remade to use the energy of the explosive in a fixed shotgun shell to fire through a smooth bore either a number of ball shot or a single projectile for each single pull of the trigger." UK law requires that a shotgun not be capable of holding more than three rounds; if it holds more it is classed as a firearm.
This definition, however, does not exactly match the technical use of the term, which would include the growing number of shotguns specifically designed to fire single projectiles instead of shot. Rifled slugs, which have fins or rifling on or behind the bullet designed to keep the bullet tracking straight at the target, is an example of a single projectile. Some shotguns have rifled barrels and are designed to be used with a "sabot" bullet. A sabot bullet is typically encased in a two-piece plastic ring and the plastic is designed to fall away after it passes the end of the barrel, leaving the bullet to continue toward the target while twisting (from passing through the rifled barrel) to keep it's trajectory. These shotguns although they have rifled barrels still use a shotgun-style shell instead of a rifle cartridge. Hunting laws may differentiate between smooth barreled and rifled barreled guns.
Also, technically speaking, many people would likely call a fully automatic shotgun a shotgun, even though legally it would fall under a different category.
There are many types of shotguns. There is the over and under shotgun, the side-by-side shotgun, both of which are types of double barreled shotguns. There are pump action shotguns and semi-automatic shotguns.
In hunting circles, the shotgun is used for bird hunting, although it is also increasingly used in deer hunting in semi-populated areas where the long-distance travel of the rifle bullet may pose too great a hazard. Many modern smooth bore shotguns using rifled slugs are extremely accurate out to 75 yards or more, while the rifled barrel shotgun with the use of sabot slugs are typically accurate to 100 yards and beyond -- well within the range of the majority of kill shots by experienced deer hunters using shotguns.
The shotgun is also commonly used for home defense in the United States and Canada. It is particularly suitable for this purpose because it is very intimidating and will often end the assault with a single shot, if it comes to that.
Shotgun also refers to a passenger riding next to a driver in a vehicle (and in old times (wild west?) carrying a shotgun to protect the vehicle and its contents). In America, there is a tradition known as "calling shotgun", which determines who gets to sit next to the driver.