A cantata (literally "sung", derived from the Italian word "cantare") is a vocal composition with an instrumental accompaniment, typically in several movements, often involving a choir. The Cantata originated from the single voice madrigals of the 17th century, and gradually evolved into the mini-oratorio of the 19th century. Most cantatas of the 18th and 19th centuries were religious in nature, with a few being secular in nature. Johann Sebastian Bach dominated the cantata composition scene with his 200+ religious and secular cantatas. His cantatas are generally recognized as the finest examples of the genre.
The Lutheran Church was one of the greatest consumers of cantatas, neccesitating the composition of large numbers of them for each church service of the year (Bach wrote most of his cantatas for such church services). The nobility and other people of great power also commissioned cantatas to be composed for special events, most often birthdays.
The Oratorio is basically a large or long cantata; Bach's Christmas Oratorio is actually a compilation of six different cantatas written for performance on six different days. That being said, an oratorio generally has an identifiable plot/narrative, with particular soloist singers being assigned identifiable characters; most cantatas do not have this feature,note although many if not most have particular soloists representing particular "speakers" or characters.