Ulcers in the mouth are quite common especially in children and young adults. Probably the most common is the Aphthous Ulcer otherwise known as a canker sore. We really don't know what causes them, but stress of various kinds can bring them on. Even if small they are quite uncomfortable. They tend to occur on the soft mucosa inside the lips or just beyond the gum tissues. There really is no cure, but they will go away on their own in about 10 to 14 days. These ulcers look like a small white spot surrounded by a red area. Any treatments are generally to reduce the discomfort. Possible over the counter treatments include baby oragel, tannic acid (Zilactin), Orabase-B ("B" for Benzocaine), Anbesol, etc.
Prescription medications my include anti-inflammatory medications such as Kenalog in orabase, or soothing mouth rinses for comfort. One I use a lot for really bad cases is a mixture of Benedryl liquid, viscous xylocaine, and maalox, all mixed together. Seems to help in some cases when there are multiple lesions. I have even seen some people use silver nitrate sticks to basically burn the lesions-hurts a lot at first but some say it helps the pain. ( I don't recommend this). As with all lesions a proper diagnosis is very important. You have to determine if it is something else. One basic guideline is, if it doesn't go away in 2 weeks, you get suspicious of other things.
Regarding canker sores: I take Vitamin B-12 everyday, twice a day, the sublingual kind. If I go without taking B-12 for more than 4 or 5 days, I start feeling a canker sore pop up. I start taking the B-12 and within hours, the canker goes away. Sometimes it's taken up to 24 - 48 hours to get enough B-12 in my system.