Both cantatas and oratorios are sung musical performances from the Baroque era that feature recitative -- spoken song -- arias, choruses and duets. They have no staging, sets, costumes or action -- in that way, both forms differ from opera, which provides a more fully realized story and theatrical presentation. Although at least one of the musical forms did not initially feature sacred themes, ultimately some of the most accomplished and memorable oratorios and cantatas were based on religious texts.
The cantata is the shorter of the two and was first a secular work, then largely sacred song and music, and eventually a form that lent itself easily to either interpretation. Cantatas typically feature soloists, a choir or chorus and an orchestra and are 20 minutes long or so, much shorter works than operas or oratorios. A cantata has five to nine movements that tell a continuous sacred or secular narrative. Haydn wrote a "Birthday Cantata" for his patron, Prince Esterhazy. Charpentier wrote a cantata for three male voices on one of his favorite classical themes, "Orphee Descendant aux Enfers" -- "Orpheus Descending to the Underworld." He later wrote a short opera on the same theme.
The oratorio is composed to a long, continuous religious or devotional libretto and was originally presented in a church. The length and elaborate orchestral, solo and choral music were just as appropriate for a concert hall, so oratorios quickly filled secular as well as religious venues with Latin -- and even English -- texts set to music that contained anywhere from 30 to more than 50 movements and ran from one and a half to two hours or more. The Passion of Christ and Christmas were two subjects that attracted composers -- or their patrons, who were often powerful religious figures. Bach's "Christmas Oratorio" and Handel's "Messiah" are frequently performed examples of the oratorio.