This trope is Older Than Feudalism. Odysseus willingly allows himself to be tied to his own mast when his ship sails past the sirens in The Odyssey. The other sailors use his reactions as a gauge for when it's safe to unclog their ears.
In Janny Wurts's book The Ships of Merior, Dakar is gagged using the cloth-in-his-mouth method. However, he somehow ingests the sponge they used and escapes.
Interesting usage in the obscure children's book Samantha Stone and the Mermaid's Quest. Samantha gradually learns the ability to teleport over the course of the story. After mistakenly teleporting right in front of an enemy, she is tied to a chair. She teleports out, and the guard is surprised to see a few scattered ropes lying on the chair. Later, they get the drop on her again and don't take any chances. Samantha is knocked unconscious, and bound - and gagged. When she wakes up, she can't cast the teleportation spell.
Nancy Drew. Oh lord, Nancy Drew. Not as often as legend suggests, though. Earlier books (the series began publishing in 1930) featured the character bound and gagged in maybe one out of every four or five stories, usually incidental to being left somewhere like a sinking boat, water tank or airtight closet, but these scenes were revised into less dangerous situations or outright deleted from later print editions. Scenes where Nancy was forcibly restrained by male antagonists were considered to have a sexual undertone and they were altered or omitted alongside anything else considered dubious by the changing social and moral standards of the times, particularly the depiction of non-white characters and even - lamentably - Nancy's initially headstrong and outspoken proto-feminist persona, which abandoned her early love of cars and excitement for more fashion and boy-oriented concerns as the series progressed.
The Hardy Boys went through a lot of this as well, at least in the blue hardcover books.
Happens often enough in the Harry Potter series. Harry gets tied up by Quirrel in book one, is bound to a gravestone and gagged in The Goblet of Fire, and the Inquisitorial Squad gags and restrains several of his friends in The Order of the Phoenix. Finally the trio and Dean Thomas are tied up when they are taken to Malfoy Manor in the The Deathly Hallows.
Snape does this to Lupin at the confrontation scene in Prisoner of Azkaban.
It should noted that all of these scenes are either changed/removed in the film adaptations, though they actually added a gagging scene in the first film, where Ron is briefly gagged by the Devil's Snare.
Interesting usage in the kids' book Jennifer the Jerk Is Missing. 8 year old Jennifer is tied and gagged, but she's so bratty, she laughs under her gag when her would-be rescuers (a 13 year old and another 8 year old) mess up and end up trapping themselves in a closet. Later, the would-be rescuers are themselves tied up and left that way overnight. The book's mood ranges from silly to suspenseful.
This happens to Torak in Wolf Brother and its sequels all. The. Time. Though he's rarely gagged, he does seem to spend quite a bit of time tied to posts in the camps of enemy clans.
In George Mann's The Osiris Ritual, Veronica Hobbes is bound and gagged by the villain.
Let's Go Play at the Adams' is made of this. 20-year-old Barbara wakes up, on page 7, to find herself tied to a bed and gagged, by the kids she was supposed to babysit, and their teenage neighbors. Barbara is literally tied up all throughout the entire 300+ page book, in a huge variety of positions, as her captors have no intent whatsoever of letting her go. Tied to a chair, tied to a bed, tied to a bench, tied to a pole, tied in many different ways, ungagged so she can eat, then regagged... it's all over the place. It's even implied that one of the teens tied up one of the kids — in her own words: "so tight that he tied my big toes together". It's also a genuinely gripping story, believe it or not, according to most reviews.
In Burning Water, by Mercedes Lackey, one minor character realizes he's been targeted by a mind control spell and demands his brother (a cop, so he actually has handcuffs available) and his sister-in-law cuff him to the bed. It holds him long enough for two other characters to break the spell.
Happens many times, in diverse ways, in The Candy Shop War. An adult who wishes to help the kids out ties up their teacher and takes her place as a substitute. One of the bullies is later forced into a straitjacket and gagged, by that same adult (the bully had become the lackey of the Big Bad, without realizing how evil she was). Later, some of the kids are wrapped up with magically controlled grass, then the girl is straitjacketed and gagged and taken as a hostage. Many good guys and bad guys, both kids and adults, are tied up or otherwise restrained.
Annabeth Chase is bound and gagged at least twice over the course of Percy Jackson and the Olympians. In the first book, The Lightning Thief, Percy has a dream in which he and Thalia are wearing straitjackets. One of the times Annabeth is bound is when she and Percy are sailing past the island of the Sirens, a direct Shout-Out to the Odyssey example above. Unfortunately, Percy forgot to take Annabeth's knife before tying her up, and she escapes her bonds and almost drowns.
The sequel series keeps up with it. Piper is bound and gagged in all three books she appears.
This happens to Maybeck when he's kidnapped in the first Kingdom Keepers book.
Happens a few times in the Pyrates series. First, Paul, a boy who lives underground, is tied to a chair and threatened by the Big Bad's henchmen. Later, Shannon, and then George when he comes to rescue her, are both bound and gagged, although very loosely in George's case (socks do not good bindings make). Then in the fourth book, George's dad's girlfriend is kidnapped to try to force a bargain with George's dad, and George and his friends have to rescue her.
The Hound Of The Baskervilles: Stapleton ties his wife to a beam and wraps her up in a large cloth to the extent that neither Holmes, Watson nor Lestrade initially could identify whether the gagged figure was male or female when they burst in.
The opening of The Sweetness at the Bottom of the Pie by Alan Bradley has the 11 year old heroine bound and gagged in a closet, struggling to free herself from her tormentors. Who are her sisters who put her in there for being bratty.
The Wheel of Time. It happens in a number of books to various characters through magical or physical meanings. Most popularly used by magic users in the form of bindings of air.
In E.W. Hildick's The Case of the Four Flying Fingers, the villain kidnaps the Kid Detectives in her vehicle, but doesn't tie them up—instead they do it themselves. When they realize that other drivers think they're playing when they yell that they're being kidnapped, they bind and gag one of the group with masking tape, put him at the window by himself, and have him signal with a flashlight in Morse Code for good measure. This display gets the attention of the cops in short order.