Secret: Before attempting this trick, ask yourself: Are you prepared to actually burn yourself while learning this trick?
Do you have what it takes? Because you will burn yourself while learning how to do this right.
It's okay if the answer's "No." You can just go learn a card trick, instead. Or maybe a math puzzle. Or maybe you can memorize a funny limerick... Everybody loves puns, right? Sure! I'm certain that limericks and puns will be every bit as big a hit as being the guy who puts fire inside his mouth and grins.
Here's the work on this one: We're going to start small and build up to something impressive. Start by sitting in front of a mirror with a bowl of ice cubes and some matches. Suck on the ice cubes for a bit to cool the roof of your mouth, then strike a match. You're going to put the match into your mouth flame-side first and bite down on the base, while making sure to inhale slowly the entire time. Inhaling draws the heat down into your lungs, and keeps it off the roof of your mouth, while the flame illuminates your mouth from the inside.
Keep in mind that even this small amount of fire is still very, very hot... all hydrocarbons burn at around 2000 degrees Fahrenheit. If you don't inhale slowly, you'll cook the roof of your mouth.
To get the mechanics down, practice with an unlit match. Get to where you can confidently and quickly place the match right into position. The more you hesitate doing the jack-o-lantern, the more chance you'll have of burning yourself. Only try it with a lit match once you're 100% confident in the moves.
When you do start working with a lit match, the odds are good that you'll inhale too quickly, blowing out the match. Keep trying in front of the mirror, inhaling less and less each time until you get a decent glow. Practice will allow you to strike a balance between the brightness in your mouth vs. the heat of the flame.
Note: When (not if) you burn your mouth, it will almost always be a first-degree burn. Refer to this page for simple care to treat your burns: Mayo Clinic
The good news about burns inside the mouth is that they heal very quickly, due to the phenomenal amount of blood that pumps through the mouth, lips, and tongue. A couple of days should set you right to try again.