The moral of a story is a lesson that is taught within the context of a tale, often using an analogy. In general, stories with morals are found in children's literature or, for adults, inspirational and motivational tales.
The most famous morality tales are Aesop's Fables, a collection of very short children's stories teaching moral lessons that are explicitly stated at the end in a maxim. Many of Aesop's maxims have passed into common usage, such as "a bird in the hand is worth two in the bush."
In adult literature, it's more common to find parables teaching morals. While fables use animals with human-like characteristics and inanimate objects as their story actors, parables exclude anthropomorphized characters. This is a relatively recent distinction, and many older parables do not follow this rule.