97 Nissan Maxima shuts down and quits running

I have a 97 Nissan Maxima that was shutting down and quit running and then if you waiting 15 min. it will start back and run fine. We have changed the starter, fuel pump, fuel pump relay, plugs and plug wires and 1 coil but now it will run for 4-8 minutes and then you have to wait about 30 minutes and it will start back but again only run for about 4-8 minutes. Any suggestion as to what is heating up and catching the car to automatically shut down?

Will it turn over after it dies?
If it cranks and cranks you need to find out if it is not getting gas or spark,timing light or spark checker and starting fluid to see if it is a gas problem.
If it does not turn over your model has trouble with the key switch.

It will turn over but not start. It is almost like something is heating up and causing it to die after running but we are lost as to what it can be.