My guess is that you've gotten a mouth ulcer (aka aphta). It is a very normal condition and it can happen for a number of reasons. I see that physical trauma and herpes have already been mentioned, and both of these conditions may cause such ulcers. If you've never had it before, I'd say that the former is the most likely cause. I myself have gotten such ulcers from biting my cheek (and I also get them every once in a while when I have a cold).
Sucky part of this is that it hurts a lot and that you'll have it for a week or two.
An ok article on wikipedia with pictures, so that you can see if this is what you have:
link And: Before you get all panicky about possible herpes, you should know that the herpes virus is latent in a huge majority of the population. It can be transmitted by i.e. drinking from the same bottle or making out with someone (who have made out with someone before that, and that person has made out with another person and that person has shared a bottle of beer with this person, so, as you can see we're all a big happy family;)). I've probably got herpes latent in my system, and the same applies to the others who have replied to your question.
Bottom line: It's very likely to be completely harmless and normal. If it's very painful or if it doesn't get any better within 2 weeks, go see a doctor.
Take care and good luck!