To add to the great answer above, an extended metaphor will often employ the comparison in different ways. For example, it will directly state the comparison:
"That whirlpool is a great big mouth."
Further on, it may use functions of the compared object to further drive the comparison. For example, the mouth may yawn or chew or vomit.
Another way that an extended metaphor is developed is through the use of other types of figurative language or adjectives. For example, using the word "devour" could be personifying the whirlpool. Using the adjective "carnivorous" could be describing the whirlpool as something that eats men.
A great extended metaphor to look at is the whirlpool Charybdis in The Odyssey.
Sometimes called a “conceit”, an extended metaphor is one that continues throughout a work. It is a comparison that, once established, occurs frequently or throughout a work. Often, it permeates the entire work. It is very common to see such extended metaphors in poetry and fiction.
Some examples are Romeo’s speech outside of Juliet’s window. He compares Juliet to the sun (“But lo! What light from yonder window breaks......”). Another example from Shakespeare is Hamlet’s speech in Act 1, Scene 2, where he compares the world to a garden that has been neglected for a long time. He is referring to his mother’s relationship with his uncle as being smething "rank" just like a neglected garden. In Macbeth, there are many instances when peoples’ roles are compared to clothing – sometimes the fit, and sometimes they do not. When the witches tell Macbeth he will be Thane of Cawdor, he states that the Thane still lives, so why do they “dress him in borrowed robes?” and later, when he is talking about killing Duncan, he tells his wife that Duncan has honored him, so why should he cast off this clothing so soon (the clothing meaning the honor).
A figure of speech in which an implied comparison is made between two unlike things that actually have something in common. Adjective: metaphorical.
A metaphor expresses the unfamiliar (the tenor) in terms of the familiar (the vehicle). When Neil Young sings, "Love is a rose," "rose" is the vehicle for "love," the tenor. (In cognitive linguistics, the terms target and source are roughly equivalent to tenor and vehicle.)
For a discussion of the differences between metaphors and similes, see Simile ("Observations").