A metaphor is a phrasal expression, which is used to make a comparison of unrelated objects and actions; an allegory is often said to be an extended metaphor.
An allegory, which is a substitute for another object or action, includes more fine points than a metaphor. When compared to metaphor, allegory can be longer passages of comparison.
“Books are the mirrors of the soul.”
– Virginia Woolf,
While metaphors are generally seen in literature, allegories are not only seen in literature, but also in sculptures, painting and a lot more.