A barrel is simply a tube through which a bullet comes out of. Most firearms these days have a single barrel, though shotguns do come in double barrel versions. This is in contrast to previous centuries when multi-barrel firearms did exist. In most cases, the barrels are cylindrical tubes, but there are also polygonal barrels and oval barrels which have been used in history. With that said, let us discuss the various terms that describe barrels.
Bore: This is a word that describes the inside of the barrel tube. The inside surface may be rifled (more modern) or smooth (i.e. smoothbore, which is what the first firearms were like).
Breech: This is the rear part of the barrel (i.e.) the end that is closest to the firing mechanism. Most modern firearms are loaded via the breech end of the barrel.
Chamber: The chamber is at the breech end of the barrel. This is the area where the cartridge is placed into, prior to firing it. The most pressure exerted on the firearm upon firing occurs in the chamber area, hence the walls must be thick enough to withstand this pressure. The manufacturing of the chamber has a lot to do with the precision and reliability of the firearm. If the chamber fits the cartridge very tightly and precisely, then accuracy of the firearm is improved, but the reliability of feeding a new cartridge into the chamber is reduced. Conversely, if the cartridge fits the chamber loosely, then the feeding of a new cartridge into the chamber is much easier, but when the cartridge is fired, it will move around in the chamber and affect the accuracy of the bullet. Therefore, a good chamber design tries to strike a balance between these two factors.
An exception to this are revolvers, which have multiple chambers in a separate cylinder. In this case, the chambers are not part of the barrel.
Freebore: In the case of rifled barrels, this is the area just forward of the chamber, but before the area where the rifling starts. It is a smooth area that guides the bullet forward where it engages the rifling.
Muzzle: This is the part of the barrel which the bullet comes out from. For early firearms, they were usually loaded via the muzzle end of the barrel. The pressure generated by the burning gases decreases as it approaches the muzzle. Hence, some manufacturers make the walls of the muzzle end of the barrel thinner than the breech end, since it doesn't have to withstand as much pressure and they can reduce the overall weight of the firearm this way.
Devices such as flash suppressors or compensators may be screwed on to the muzzle end of the barrel.
The length of a barrel depends on the type of firearm. Rifles and shotguns have barrels starting from around 17-18 inches in length and go all the way to 60 inches or longer. Revolvers and pistols tend to have barrels in the 3-5 inch range, though there are exceptions to this rule of course.
When a cartridge is fired, the expanding gases act on accelerating the bullet as long as it is still within the barrel. Once the bullet leaves the barrel, the expanding gases no longer act on it and the bullet is no longer accelerated. Hence, if the barrel is longer, then the expanding gases act on the bullet for a longer time and allow it to come out with greater velocity than if the barrel is shorter. On the other hand, longer barrels are harder to aim with. Hence, the design of a firearm must strike a compromise between these factors.
Cross-sections of three barrel types. Public domain image
In the above image, we see the cross-sections of three different barrel types. The left one is a smooth bore barrel, the middle one is a rifled barrel and the right one is a polygonal barrel.