Hello~It looks exactly like the canker sores I use to get. I would hold some warm salt water in your mouth so it covers it, this is sometimes all it takes to get rid of it, otherwise, if it continues or gets worse, see your dentist.
Could be a boil, abscess, or canker sore. It can't be diagnosed from a picture. If it persists or grows, you'll need to see a dentist. If it's an abscess, antibiotics will be required.