The tongue-in-cheek figure of speech is used to imply that because what one is saying or writing is ironic or flippant, and it should not be taken at face value.
The phrase was originally meant to express contempt. For example, in Tobias Smollett’s The Adventures of Roderick Random, published in 1748, Mr. Smollett is taking a coach to Bath and apprehends a highwayman. This provokes an altercation with a less brave passenger and Smollett says, “I signified my contempt of him by thrusting my tongue in my cheek, which humbled him.”
By 1842, however, the phrase had acquired its contemporary meaning, indicating that a statement was not meant to be taken seriously. It appears in the 1842 poem, “The Ingoldsby Legends” by the English clergyman Richard Barham, in which a Frenchman inspects a watch and cries:
‘Superbe! Magnifique!’ (with his tongue in his cheek)
This ironic usage originates with the idea of suppressed mirth—biting one’s tongue to prevent an outburst of laughter.
The phrase “tongue in cheek” refers to the act itself, of surreptitiously pushing one’s tongue, noticeably, into one’s cheek on either side of the face. It is tantamount to a wink.
The expression has largely fallen out of vogue since the mid-to-late 20th century.
I tried putting my tongue in my cheek and, while I can do it, found it rather uncomfortable. I like irony, but will stick to winking if my meaning isn’t absolutely clear.