This is a relatively common problem on these Jeeps. You most likely have a bad/failing crankshaft position sensor. The crankshaft position sensor tells the PCM (Powertrain Control Module) that the engine is turning, so it will fire spark and fuel. Without that signal the PCM will not supply fuel/spark and as a result, you get an intermittent stalling or no-start condition.
Here is where the sensor is located:
I hope this helps! Let me know if you have any more questions!