Many people think the only point of art is to be aesthetically pleasing and to allow people to express themselves. While that is largely true, it's not all there is to art. The emergence of the first forms of art, namely in ancient civilizations like Greece, Mesopotamia, and Egypt, held a purely religious context. Different gods, goddesses and divine forces were often represented as statues or paintings.
A well-known example of religion in art is the pyramids, which were used as tombs for the pharaohs. In fact, most Egyptian paintings that have survived were found in those tombs. They depict scenes of the afterlife, different gods of the underworld or things that people could take with them to the afterlife, like food and servants. Statues in ancient Egypt often portrayed different pharaohs, because pharaohs were considered gods in ancient Egypt. The same can be said about ancient Greece. There were 12 major Olympian gods in ancient Greek mythology, apart from the many satyrs, nymphs and spirits that were also part of the religion. One of the ways in which ancient Greek mythology and art mixed was in their pottery. It was mostly painted black and orange and depicted scenes from different myths showing gods, goddesses, heroes and satyrs, as well as scenes from daily life. Here is a website with many examples of ancient Greek pottery. Ancient Greek gods and goddesses were also often depicted as statues and paintings. Religion can also be seen in their architecture. The most famous ancient Greek building today, the Parthenon, was first built as a temple dedicated to the goddess Athena.
Another example of religion in art is icons. An icon is a painting that portrays different angels, saints, and often Christ and Mary. Icons are mostly used in Eastern Orthodox, Oriental Orthodox and, to an extent, in the Catholic church. Icons can be painted on wood, cast in metal, embroidered on a cloth, etc. Sometimes icons are portraits of different saints, and sometimes they depict whole scenes from the bible. Icons were used in the Eastern Roman Empire, but there are not very many left. Some countries with recognizable and world famous icon art are Greece, Russia, Romania, Egypt and Ethiopia. in ancient times, the point of icons was to educate illiterate people about religion, but nowadays they're just a traditional part of some religions.
The first art that humankind ever made was for religious purposes. Even the Gothic art of the middle ages dealt only with religion. Most often, paintings were commissioned by the church and portrayed religious subject matter. Baby Jesus and Mary were a subject often dealt with; such as Cimabue's Madonna and Child Enthroned. Even the majority of the famous buildings of Europe that remain from the Middle Ages are connected with religion, such as the Notre Dame de Paris or the Cologne Cathedral in Germany. During the Renaissance, art started to become more diverse, though religion was still a huge topic. Wealthy families began commissioning portraits and artists began to paint non-religious subject matter, although they often tried to paint in a way that could be interpreted as religious.
For centuries religion has played a large part of people's lives, and continues to today. This is evident in the art and architecture of different cultures. Slowly, religion and art separated, but there remains a great deal of religious art left to remind us of its original purpose.