A rivet gun is a tool that fits rivets, metal parts that permanently join two sheets or components without the need for a screw or welding. The most common is the blind rivet gun, which lets you work from one side of the part only.
In locksmithing it is used to fix reinforcing plates, attach stops on metal roller shutters, secure plates and keeps on metal storeroom or garage doors, or repair hardware where a screw would not hold. A properly fitted rivet does not work loose with vibration.
It also has a security advantage: what is riveted on the outside cannot be taken off with a screwdriver. That is why it is so common on reinforcements for metal and storeroom doors. If you are interested in reinforcing yours, see door reinforcement.