From the photo it looks like a possible apthous ulcer. Usually these appear when stressed or when your immune system takes a dip. They usually go away after +- 10 days. The treatment is usually only symptomatic relief, like rinsing with a mouthrinse etc.
If it does not disappear within that time, or if it enlarges and becomes more ulcerated, I would suggest seeing an oral surgeon. The lesion then needs to be biopsied to confirm diagnoses.