Off-key is musical content that is not at the expected frequency or pitch period, either with respect to some absolute reference frequency, or in a ratiometric sense (i.e. through removal of exactly one degree of freedom, such as the frequency of a keynote), or pitch intervals not well-defined in the ratio of small whole numbers.
The term may also refer to a person or situation being out of step with what is considered normal or appropriate. A single note deliberately played or sung off-key can be called an "off-note". It is sometimes used the same way as a blue note in jazz.[1]
The opposite of off-key is on-key or in-key, which suggests that there is a well defined keynote, or reference pitch. This does not necessarily have to be an absolute pitch but rather one that is relative for at least the duration of a song. A song is usually in a certain key, which is usually the note that the song ends on, and is the base frequency around which it resolves to at the end.
The base-frequency is usually called the harmonic or key center. Being on-key presumes that there is a key center frequency around which some portion of notes have well defined intervals to.
In jazz and blues music, certain notes called "blue notes" are deliberately sung somewhat flat for expressive effect. Examples include the words "Thought He Was a Goner" in the song "And the Cat Came Back" and the words "Yum Yum" in the children's song "Five Green and Speckled Frogs".