A utopia is a fictional society considered perfect by its proponent, but whose implementation in reality is unrealistic. The term, greek in origin, was first used by Thomas More, for its 1516 eponymous book, which describes a fictional state whose laws and organization are purportedly ideal. However, More's intent was, at least in part, ironical, as some ambiguities in the text clearly show: the word "utopia" can mean both "good place" or "place that doesn't exist", and the narrator's last name, Hythlodaeus, literally means "purveyor of nonsense".
Utopian literature was, however, not created by More; it comes from the fusion of several archetypes, which can be found in classical literature and mythology, religion, and philosophy. The most important influences were the Greek accounts of voyages in faraway, fantastic lands (such as Hyperborea or Thule), the narration of a fall from a privileged and carefree condition in religion and mythology (such as Hesiod's Golden Age, or the Genesis' Fall from Eden), and philosophical inquiries about the nature of the perfect state, of which the most influential was undoubtedly Plato's Republic. More and Plato disagree on what makes a perfect society: for example, while both societies are socialist, Plato advocates the communion of women and families, whereas More, a Christian, could not agree with that. This shows that utopias are, by their own nature, subjective and arbitrary, as different individuals will have different ideas on what constitutes a "good" society. A utopia, seen from a different point of view, can become a dystopia, that is, the description of a society which claims to be ideal but which ends up being a nightmare.
It is also interesting to note that utopias, while having some similarities with religious paradises, are incompatible with them: to be perfect, a paradise only needs an act of will by a deity; man only needs to gain access to the paradise through his actions on Earth (the exact requisites change from religion to religion: in the old Norse religion only valiant warriors fallen in battle could access the Valhalla, whereas the Christian Paradise is reserved for the righteous) and no special laws or measures are required to keep that paradise perfect. On the contrary, Utopia is a man-made paradise; it is perfect because it is carefully engineered to be so, and constant human intervention is required to prevent it from declining or falling.
This, according to professor of sociology Krishan Kumar, reflects two particular Christian views of human perfectibility: utopianists believe in the Pelagian view that man can make himself perfect through his actions, whereas the dystopian view reflects St. Augustine's doctrine: God can be the only source of perfection, everything that man does is doomed to fail, and only faith can save man.
Utopian literature was highly popular from the 16th to the 19th century, a period in which many utopian works were published. After the Industrial Revolution the faith in a bright future of peace and abundance that would be brought by scientific progress was so strong that utopian literature almost disappears, to be replaced by actual political projects and theories, as utopia seemed at last to be reachable. It's in this period that dystopian literature is born, as a reaction to the doubts and fears of those who were convinced that the utopias, once realized, would end up being nightmares and leading mankind to self-destruction.
The utopian project that mostly influenced dystopian literature was Marxism, which, with its extremes and its further degeneration into Soviet Communism, convinced many intellectuals, such as Yevgeniy Zamyatin or George Orwell, that steps were to be taken to prevent the appearance of totalitarian regimes disguised as utopias.
Partial list of the most important utopias, and of its most influential archetypes
Thomas More's Utopia (1516)
Tommaso Campanella's The City of the Sun (La Città del Sole, 1604)
Johannes Valentinus Andreae's Christianopolis (1619)
James Harrington's The Commonwealth of Oceana (1656)
H.G. Wells's A modern utopia (1905)
Dystopia, the flipside of Utopia