A gag is any thing used to stop a person from speaking. This is done by blocking or muffling the person's mouth and making it difficult for them to move their jaw and tongue in a normal way.
Gags are very commonly seen in BDSM and bondage fantasy. Many different items can be used, ranging from a hand simply clamped over the victim's mouth, to a scarf tied between the jaws, to adhesive tape placed over the mouth and face to seal the lips. There are also many kinds of specially-made gags, which usually strap around or behind the head. Special gags of that kind are usually made from leather or rubber.
In real life it is quite difficult to gag a person in such a way that their speech cannot be understood at all, and it is almost impossible to prevent a gagged person from making some kind of sound. It is also a risk to the person's safety, as the more tightly and securely someone is gagged, the greater the risk that they will choke or suffocate.