As tylerharms notes in a comment beneath the original post, the notion of biting one's tongue instead of speaking or taking action goes back (in English) at least to Shakespeare. From Henry VI Part 2 (1591):
Pirates may make cheap penn'worths of their pillage,/ And purchase friends, and give to curtezans,/ Still reveling, like lords, till all be gone:/ While as the silly owner of the goods? Weeps over them, and wrings his hapless hands,/ And shakes his head, and trembling stands aloof,/ While all is shar'd, and all is borne away;/ Ready to starve, and dares not touch his own./ So York must sit, and fret, and bite his tongue,/ While his own lands are bargain'd for, and sold.
Biting one's tongue to stifle the urge to speak also seems to have a long history in Spanish. Cervantes uses it several times in Don Quixote and in his A Dialogue Between Scipio and Bergansa, Two Dogs belonging to the City of Toledo. From a 1762 translation of Cervantes's Don Quixote:
To which he answered: Signor Don Quixote, pardon me; I confess I was in the wrong, in saying, that the lady Dulcinea would hardly equal the lady Belerma: my understanding, by I know not what guesses, that your worship is her knight, ought to have made me bite my tongue sooner, than compare her to any thing but heaven it self.
And from a 1767 translation of A Dialogue Between Scipio and Bergansa:
Bergansa: ...What I said was not to lay a law upon me, but only a bare promise, that I would bite my tongue, whenever I censured anything; and now-a-days such things are not so strictly observed as formerly; for today a law is made, and tomorrow it is broken, because perhaps it suits not with our conveniency to keep it; and in on moment we promise to amend our faults, and the next fall into greater; it is one thing to commend good laws and regulations, and another to submit ourselves to them; in a word, saying and doing are two things; let the devil bite himself if he will, for me, for I am not such a fool as to bite my own self, nor practice things upon a mat, where there is no one sees me, who may applaud my heroic actions.
Scipio: I find by this, Bergansa, that if you were a man, you would be a hypocrite, and that all your deeds would be only in outward appearance, done in the eyes of the world, and covered with the cloak of virtue, that you might gain the praise of good men, as in general all hypocrites endeavor to do.
Bergansa: I know not what I should do then, I am only sensible what I shall do now, which is, that I will not bite my tongue, having so many things to say, that I know not how nor when I shall be able to finish them; and more so, seeing I am afraid, left at the break of day our speech should be taken from us again, and then we must remain in the dark, as to all these things.
A similar notion appears in Jean-Jacques Rousseau's Eloisa. Here is a sentence from a 1761 translation of that book:
My mouth was open to add that the castle was like that of Lord B___, —who ... but luckily I had time to bite my tongue.
I suspect that the original notion of biting one's tongue was more vivid and violent than the mere idea of silencing oneself by inflicting a sharp nip on a delicate body part. This example, from Susanna Moodie, Geoffrey Moncton: or, The Faithless Guardian (1855) suggests the possibility of rendering oneself incapable of speaking by actually biting off one's tongue:
I could have bitten my tongue off for my want of tact, but the blunder was out, and she answered with some asperity.
The character in Moodie's book is obviously exaggerating, but other sources take the threat literally. Thus Wellens Calcott, A Candid Disquisition of the Principles and Practices of the Most Ancient and Honorable Society of Free and Accepted Masons (1769) cites an example from Pliny:
Annaxarchus, who (according to Pliny) was apprehended in order to extort his secrets from him, bit his tongue in the midst, and afterward spit it in the tyrant's face, rather chusing to lose that organ, than to discover those things which he had promised to conceal.
And from a 1784 collection of old ballads, we have "The Spanish Tragedy; containing the lamentable murder of Horatio and Bellimperia: with the pitiful death of old Hieronimo [Part 2]":
To torture me they did prepare,/ Unless I should it straight declare./ But that I would not tell it then,/ Even with my teeth I bit my tongue,/ And in despite did give it them,/ That me with torments sought to wrong.
As for the question of when someone first invited someone else to "Bite your tongue," here is the last quatrain of a poem anachronistically titled "The Telegraph Inverted" from John Lauderdale, A Collection of Poems, Chiefly in the Scottish Dialect (1796):
Not meaning further for to teaaze ye,/ I on my hono'r here advise ye,/ 'Afore ye tak' a side that's wrong,/ To just sit down and bite your tongue.
The "telegraph" of this poem appears to be something akin to a telescope, since the poet says that he "rais'd it up to tak' a view,/ Just i' the end ye looket thro'."