A trilogy is a set of three books or movies that together, tell one long story.
A trilogy may also be a set of works that explore a common thematic element, though each work may stand as a separate work as well.