Allegory is a form of extended metaphor, in which objects, persons, and actions in a narrative, are
equated with the meanings that lie outside the narrative itself. The underlying meaning has moral, social, religious, or political significance, and characters are often personifications of abstract ideas as charity, greed, or envy.
Thus an allegory is a story with two meanings, a literal meaning and a symbolic meaning.
Example:
Fairie Queen Spenser; Pilgrim's Progress by John Bunyan; Young Goodman Brown by Nathaniel Hawthorne