What causes the parotid glands to become swollen and painful?

Many things. Cysts, tumors, occluded ducts, salivary duct stones, and mumps virus( bilateral swelling) are most common.
A few things.... If it is both sides, you may have the mumps, although other viruses can also cause this. If it is one side, it could be an infection, inflammation, a cyst, or perhaps some blockage from infection, inflammation or a sialolith (salivary gland stone). Your physician (or an oral surgeon) should be able to determine the cause with a personal examination, a medical history and some tests if necessary.
Mumps. Check with your md. If it is not mumps, then you could have a blocked salivary duct.
Parotid gland. It can be blocked duct and is building up, which can cause pressure. See an oral surgeon for an exam.