Yellowstone needs 2 days, and if you're already there, I would strongly recommend an additional day for Grand Tetons.
Glacier needs 2-3 days depending on how much hiking you want to do, but you should check to see if the east side of the park will be open this summer before heading out there. Last summer the Native Americans that surround Glacier shot down the roads through their land, thereby cutting off several of Glacier's most beautiful areas (Many Glacier, Two Medicine) and creating awful traffic jams in what remained open as a result.
As for Shabbos, Chabad of Jackson, WY is great, and there are a few options in MT (Bozeman is convenient to Yellowstone, and Kalispell to Glacier).