Jeep looses power after driving for 15 miles or so. Happens when I come to a stop like at end of freeway ramp. Then when I try to accelerate it boggs down and sometimes stalls. Soon after the engine light comes on. Then when I turn car off or start up after stalling it seems ok. After accelerating from a stop it will sometimes not shift like it should and then shifts at around 3000rpm. After I drive it the next day or so the engine light goes off on its own.
Great news! Your Jeep is equipped with OBD (on-board diagnostics), so you should be able to do this without much hassle.
When it happens, immediately pull over and turn the Jeep off, and turn the key 3 times in succession, turning the key just until the odometer lights up. On the 4th key turn, the CEL (check engine light) codes will flash (either one, or multiple). Write those down! They will be a PXXX number.
Post up the error code here or use a site that details the code reasons, which will tell you what is going on with the vehicle.
If your Jeep is making the CEL disappear when you turn off the ignition, make your way to an Autozone/O'Reilly's type of place while the light is on and have them plug in their diagnostic tool.
I will inform you that my 2000 Jeep Grand Cherokee had similar issues to what you describe, and a cam position sensor had gone out. I replaced that and it fixed the issue.
Most modern cars will go into a 'safe' mode if they detect a problem which could potentially damage the engine this will typically retard the ignition and reduce the rev limit to reduce engine load as much as possible but still allow you to get home.
The sort of intermediate fault you are describing suggests either a sensor problem or an ignition or other electronic issue. A bad crankshaft sensor often causes these sorts of symptoms.
As others have mentioned the first step is to plug in an OBD sensor and read the fault code which will at least narrow down the problem. You can either buy one yourself fairly cheaply or take it to reputable mechanic.
In many cases a particular code will either be just a bad sensor or relate to some known issue with that particular make and model.