An idiom is an expression whose meaning does not seem to follow logically from the combination of the meaning of its parts and the "rules of language"; the term could be defined as a language oddity.
A second meaning is in relation to one's language, and can be applied in specific graduations, for example, one's city, one's county, or one's country; a dialect may be referred to as an idiom, when focusing on lexicon and not on the pronunciation-aspects of dialects, similarly to jargon.
The more common usage, however, is the first definition above. For example, in English, a person may be said to be "under the weather" (meaning temporarily unwell), even though this has nothing to do with weather or being literally "under" anything. Idioms are often, though perhaps not universally, classified as figures of speech.
Virtually all idioms are peculiar to their own language (or even dialect; such as with Cockney rhyming slang), although some have passed in translation from one language into another: "Get lost!" (meaning "Go away!" or "Stop bothering me!") is said to be a direct translation from Yiddish. This language specificity makes idioms almost universally frustrating for non-native language users.
It is probably the case that every human language has idioms, and very many of them. In the case of English, a typical commercial idiom dictionary lists about 4000. Some people nonetheless lament the existence of idioms, and argue that they should be replaced with expressions that "actually make sense". Others don't care, while some deeply appreciate the existence of idioms.
Catch phrases and bits of slang or jargon are sometimes called idioms. They are somewhat related, but some people passionately argue that they are not actually idioms. In any case, they are not idioms in the sense discussed here.
See also List of idioms.