Erotic art covers any artistic work including paintings, sculptures, photographs, music and writings that is intended to evoke erotic arousal or that depicts scenes of love-making.
Some believe defining eroticism may be difficult since perceptions of what is erotic fluctuate. For example, a voluptuous nude painting by Peter Paul Rubens could have been considered erotic or pornographic when it was created for a private patron in the 17th century. Similarly in the United Kingdom and United States, D. H. Lawrence's sexually explicit novel Lady Chatterley's Lover was considered obscene and unfit for publication and circulation in many nations thirty years after it was completed in 1928, but may now be part of standard literary school texts in some areas. In a different context, a sculpture of a phallus in Africa may be considered a traditional symbol of potency though not overtly erotic.
A further distinction needs be made between erotic art and pornography, which also depicts scenes of love-making and is intended to evoke erotic arousal, but is by definition not fine art. However, no such objective distinction exists; the (lack of) distinction is sometimes facetiously summed up as "That which I like is erotica; that which you like is pornography."
Among the oldest surviving examples of art are paleolithic cave paintings and carvings. Among the more common images of animals and hunting scenes, depictions of human genitalia, thought to be fertility symbols, may be found. For example, a recently discovered cave art at Creswell Crags in England, thought to be over 12,000 years old, includes some symbols thought to be stylized versions of female genitalia. However we have no indication that these were made for erotic stimulation, it is far more likely that these were objects used in religious rituals. 
The earliest clearly salacious depictions of sexual behavior can be found on ancient Greek ceramics. Some of them are renowned because they contain some of the earliest known depictions of same-sex erotic behavior.
Another famous example comes from the Roman town of Pompeii which was simultaneously destroyed and preserved by the eruption of Vesuvius in AD 79. Several of the houses excavated had rooms with detailed and sexually explicit murals. For more see: Erotic art in Pompeii.
In Europe, starting with the Renaissance, there was a tradition of producing erotica for the amusement of the aristocracy. In 1601 Caravaggio painted the "Love Triumphant," for the collection of the Marquis Vincenzo Giustiniani. The latter is reputed to have kept it hidden behind a curtain to show only to his friends, as it was seen as a blatant celebration of sodomy. The tradition was continued by other, more modern painters, such as Fragonard, Courbet, Millet, Balthus, Picasso, Degas, Toulouse-Lautrec, Egon Schiele, who served time in jail and had several works destroyed by the authorities for offending turn-of-the-century Austrian mores with his depiction of nude young girls, and so on.
However, the Europeans pale before the great erotic artists of the east. Unencumbered by Christian dogma, Japan, China, India, Persia and other lands produced copious quantities of art celebrating the human faculty of love. The works depict love between men and women as well as same-sex love. In Japan, the erotic art found its greatest flowering in the medium of the woodblock print.
The style is known as shunga (pictures of spring), with some of its greatest practitioners (Harunobu, Utamaro, etc.) producing large numbers of works. Painted hand scrolls were also very popular. The Chinese tradition of the erotic is extensive, with remarkable examples of the art dating back as far as the Yuan period (1280-1367). Unfortunately not much survives as a result of Mao Zedong's revisionist destruction of pre-communist art during his Great Leap Forward.
Whether or not an instance of erotic art is obscene depends on the standards of the community in which it is displayed.
In the United States, the 1973 ruling of the Supreme Court of the United States in Miller v. California established a three-tiered test to determine what was obscene - and thus not protected, versus what was merely erotic and thus protected by the First Amendment.
Delievering the opinion of the court, Chief Justice Warren Burger wrote, "The basic guidelines for the trier of fact must be: (a) whether 'the average person, applying contemporary community standards' would find that the work, taken as a whole, appeals to the prurient interest, (b) whether the work depicts or describes, in a patently offensive way, sexual conduct specifically defined by the applicable state law; and (c) whether the work, taken as a whole, lacks serious literary, artistic, political, or scientific value."