Hello what I can understand from your question and your age it is mostly because of erupting wisdom tooth or third molar. This might sometimes cause something called as pericoronitis which is pretty painful
Next Steps
I would advise you to visit a nearby competent dentist and get a X-ray done of the area, followed by treatment of pericoronitis or removal of wisdom teeth as situation demands.
Health Tips
Do visit qualified dentists only for dental problems.