You have a condition called as Pericoronitis. The pain is due to the impacted wisdom tooth (wisdom tooth which is not fully erupted into the mouth), the overlying gum tissue of which is inflamed.
Next Steps
You have to see your dentist immediately and get it sorted.
Health Tips
An x-ray might be taken to assess the situation. One option is to cut the overlying gum tissue under anesthesia. However, this is only temporary and the problem might recur. The other option is to get your wisdom tooth removed, which is a more permanent solution. However, the situation has to be assessed by your dentist first to make a call about the treatment option.