I've had them in there as long as 10 hours and still burned my fingers when pulling the pork... 1 hour minimum is best, and preferably less than 10 really. Last weekend we did a large cook and had them in the cooler for 5 hours, again burning fingers when pulling.
It all depends on ambient conditions and all but several hours. I have held a butt for 5 hours before and I bet some have gone longer. If you can monitor the meat temp while it is in the cooler, you will be safer.
I do 4-6 hours all the time, still to hot to handle without gloves. It does as mentioned depend on how and what you use. A good quality dry cooler and wrapped in heavy towels or blankets will help.
" how long can i rest in a cooler" with that kind of title I thought your wife had kicked you out and you were lookin for a place to sleep. As far as question goes I have held for about six and it was still to haot to handle bare handed.
you can rest the meat there until the internal temp comes down to 140 degrees, not that you would be doing that but that's the cut off and depending on the cooler that could take quite awhile especially if you wrapped them in towels and set them on a heating pad in the cooler. hope this helps