The word "gag" has a few different meanings, depending on whether it’s used as a verb or a noun.
When used as a verb, "gag" means to choke or have the feeling of choking, or it’s a natural reflex of the tongue pushed to the back of the mouth to prevent an object from going down the throat:
Michelle gagged a little when the doctor swabbed the back of her throat.
Brian gagged on some brussel sprouts that his mother told him to eat.
The idea of eating an earthworm makes me want to gag.
That’s so gross, it makes me want to gag.
When "gag" is used as a noun, it’s a joke or a plan to create a funny situation.
Saturday Night Live is a television program well known for raunchy humor and politically-inspired gags.
Gags written for the performance weren’t very funny.
Samantha has been the victim of several office gags over the last few years.
A gag can also be something that prevents a person from speaking:
The thieves tied up their victims and put gags in their mouths.
The judge imposed a gag order on everyone serving on the jury. (gag order = a legally-binding directive that comes from a judge)
The man was prevented from speaking through the use of a a gag placed in and around his mouth.