I drive my Hyundai Elantra GLS for 5 minutes and then the car shuts off. That is why all the lights on the dash board come on. I can't start it but two hours later I can. What could be wrong?

Check your alternator switch. It might not be tight enough. Your battery may also be bad, I would go to your local checker auto or autozone and have them test your alternator and battery. If the car is 96 and newer, you can get it scanned for free at many auto parts stores. I suspect from your description that something is getting hot and thus killing the ignition. Many times it can be the ignition module that is the culprit. You may be able to get a cheap one from the junkyard to test this.