If the expression states things are similar using "like" or "as" then: it is a similie. If the expression does not use them, i.e. says something "is" something else then it is a metaphor. If the expression compares i.e. says something is to something else, as so and so, is to such and such, then: it is an analogy. An extended (long) metaphor is an allegory.