A double entendre is a figure of speech in which a spoken phrase is intended to be understood in either of two ways. In most cases, the first meaning is straightforward, while the second meaning is less so; often risqué, inappropriate, or ironic.
The Oxford English Dictionary defines a double entendre as especially being used to "convey an indelicate meaning". It is often used to express potentially offensive opinions without the risks of explicitly doing so.
A double entendre may exploit puns to convey the second meaning, but puns are more often used in sentences which do not have a second meaning. Double entendres tend to rely more on multiple meanings of words, or different interpretations of the same primary meaning; they often exploit ambiguity and may be used to introduce it deliberately in a text. For example, in the thriller The Silence of the Lambs, Dr. Hannibal Lecter states he is "having an old friend for dinner" — the statement innocently reads as him having invited the friend to share an evening meal, but awareness of the character's cannibalism suggests that he intends to eat the friend as the meal. Another example of this would be the title of the short story, "The Most Dangerous Game", by Richard Connell, in which the title can refer both to a "game" that is most dangerous to play, and the "game" that is most dangerous to hunt.
In some double entendres, the second meaning may require replacing an "innocent" word by a completely dissimilar "risqué" one, this "key" being suggested only by the context, or by the altered sentence being known to the audience.