The subject of a cantata can be either sacred or secular text. An oratorio always takes its subject from the Bible.
A cantata is a piece of music the composer divided into multiple sections called "movements." The oratorio is a complete piece of music broken into usually two acts.
The oratorio takes its inspiration from opera, whereas the cantata mimics a genre of instrumental music known as the sonata.
With opera being the model, oratorios sometimes involve costumes, staging, sets and soloists. Unlike opera, the soloists in an oratorio do not interact with each other. The cantata, on the other hand, involves none of these elements.
Cantatas, initially involving one or two solo singers with harpsichord accompaniment, evolved to the point of involving choirs and soloists with orchestras. Oratorios, on the other hand, rarely deviate from the established format.