If jeep is driven for an amount of time, it shuts off. I tried to restart, but nothing will happen with the 1st attempt. Then on the 2nd or 3rd attempt it will start, but it takes a few seconds to turn over.
It sounds like there may be a problem with your fuel pump. A lot of times when a fuel pump is starting to go bad it will stop working once it warms up. When it stops the fuel pressure will drop and the engine will stall. When it starts working again the engine will crank longer than usual since the fuel pressure has to build up again. I would ask for help from a mechanic, possibly one from YourMechanic, who has the proper knowledge and diagnostic equipment to figure out exactly what is causing your problem.