For a prime rib to cook in a 350 degree oven, it should take 23 -27 minutes per pound, depending on how well done you want it to be. Once you take it out of the oven, tent it with foil, and it will continue to cook for about 10 minutes. With potatoes au gratin in the same oven, you will be introducing an element of steam from the potatoes into the oven, so the meat will cook a little faster. The potatoes may take a little longer than if they were in the oven by themselves, because the presence of the prime rib will interrupt the circulation of the heat.
When I cook a whole tenderloin, I usually put the meat in at 450 degrees for 10 minutes, then turn the heat down to 325 for 25 minutes, then let it sit for 10 minutes before cutting. If I’m making scalloped potatoes with it, I usually put the potatoes in for 30 minutes, take them out, turn the heat up to 450, put the meat in for 10 minutes, turn the heat down to 325 and put the potatoes back in the oven. Once the meat comes out, I check the potatoes and usually leave them in for the additional 10 minutes while the meat finishes on the top of the stove. At this point, sometimes I cover the potatoes with foil if they are starting to get too brown.