Rifle
There are many different types of rifles but they are all very similar (including muzzle-loaders, assault rifles, hunting rifles, etc.). They have a long thick barrel to withstand the pressure of the explosion. They also have rifling inside the barrel, which is grooves on the inside of the barrel that make the bullet spin so it is more accurate.
Handgun
Handguns are very similar to rifles because their barrels are also thick and have rifling. They have shorter barrels than rifles because they are made to be shot with one or two hand instead of on your shoulder.
Shotgun
Shotguns are different from rifles and handguns because their barrels are thinner because they don't have to withstand as much pressure. They also have no rifling because this allows the wad to push out the pellets/slug more easily with less friction.