All the answers that no name gave, plus flooding it with gas.
Over heating can cause big engine problems. Or you could have water in you gas tank. Laura (ans below) is right also.
Check all your fluids, then go to a station and have them run
an computer analysis on your car.
Usually what you describe is a symptom of a worn timing chain or belt. Though the timing is slightly off due to the wear, it will still function when cold. Once the engine gets hot all the other parts involved (pulleys and gears, valve stems, lifters and push rods etc.) expand and throw the timing so far off, the engine will no longer run, until that is, it cools down and the other parts contract once again.