When someone says to you, “Hold your tongue!” that person wants you to keep quiet, to remain silent. The word “hold” is meant in the sense of “refrain.”
Chaucer used the idiom in The Tale of Melibus (c. 1387): “Thee is better hold thy tongue still, than for to speak.” A variant appears in the traditional wedding service, telling anyone who knows that a marriage should not take place to “speak now or forever hold your peace.” This appeared in the first half of the 1300s.
The idiom means almost the same thing as “bite your tongue,” which dates back to the 1590s. If you actually bite your tongue, meaning to hold it between your teeth, it is extremely difficult to speak. Therefore, doing so would certainly stop you from saying something that you might regret. However, it is often used after someone has said something instead of before.
Perhaps the warning is meant to be taken to heart in case the speaker is tempted to mis-speak again. It’s similar to the situation where a mother says to her child, “Cover your mouth,” after the child has already coughed openly. The advice is too late to be useful now, but, if the child remembers, it may serve to prevent repeat offences.
To me, the expression “bite your tongue” seems to encourage the speaker to punish his tongue for uttering something unpleasant. This would make the expression one of reproof rather than warning. It can be a way of saying, “Shame on you!”
The Oxford English Dictionary uses an example from Shakespeare’s Henry VI (1593): “So Yorke must sit, and fret, and bite his tongue.”
In my experience, when someone says, “Hold your tongue,” it’s usually said in a scolding way, as an attempt to prevent the speaker from saying more and thus getting into trouble. I use “bite your tongue” to tell the speaker to punish his tongue for what it said. Sometimes, I even say it to myself.
And, on this subject, I will henceforth hold my tongue.
But, on another subject, I will say to you all, “Merry Christmas!”