A gobstopper was the slang term in the British Navy for a large piece of round shot that an officer would make a younger sailor -- say, a teenage midshipman -- hold in his mouth, usually to shut him up.
"Gob" is slang for mouth; related words are gobbet (a lump of food or meat), gobsmacked (surprised, smacked in the mouth), and gobshite. You might tell someone to shut up by saying "stow your gob".