Music has been part of Christianity since the beginning. Followers believed in letting the love of their hearts out through songs of praise. Developing beautiful music became a work of devotion, for God was the inspiration. Aurelius Augustine, who lived around 400 AD, held that the praise in singing was a foretaste of the joy in Paradise.
Early church music consisted of chanting. It was inspired by Jewish traditions mixed with Greek music theory, and was monophonic, which means it was sung in only one voice. The music we know as Gregorian Chant developed during this period, and survives because it was codified under Pope Gregory the Great. Hildegard von Bingen is an important composer from this period.
Slowly, the music of the church evolved more voices, first moving in parallel to each other and later in contrast. A hollow-sounding music called organum was the result. Leonin and Pérotin were composers during the 12th century who wrote in this style, now also referred to ars antiqua or the old art. The new art would be the intricate polyphonies of the 14th century, a music so difficult that singers sometimes failed to perform it. The organ would continue playing or improvise on the theme, and thus liturgical organ music was born.
The Church during the Council of Trent decided it needed simpler music, so that the entire congregation could understand the words and themselves take part in the praise. Palestrina was appointed with the task, and carried it out so admirably that he has been regarded as the foremost Renaissance composer.
During the Baroque, music again became ornamented just like the furniture and buildings of the period. Bach created brilliance as only he could do. Händel created the oratorio which is a sacred sort of opera. The glory of God shone out through the music, hallelujah!
In the 18th century and beyond, writing psalms and hymns seemed to become a hobby for every other person with religious interest. Old tunes were re-used and secular melodies were given Christian themes. Indeed, music inspired by the Devil such as jazz made its way into church music and became gospel music.
Cathedrals were built big for a reason. God loves a good gig.
This writeup deals with only a part of church music. I have merely covered the Western development and not the Byzantine or the Russian or Greek Orthodox music. Hopefully someone more familiar with it than I can add to our common knowledge.