Heat the oven to 375°F (190°C). Coat a 9 × 13-inch baking dish with nonstick cooking spray and set it aside.
Pour the whole milk and heavy whipping cream into a large pot or Dutch oven. Add the garlic salt, dried thyme, and black pepper. Stir thoroughly so the seasonings are distributed throughout the liquid.
Peel the Yukon Gold potatoes and cut them into uniform 1/8-inch slices. As each portion is sliced, place the potatoes directly into the prepared cream mixture to help prevent discoloration. Keep the slices as submerged in the liquid as possible.
Set the pot over high heat and bring the cream mixture to a simmer, stirring frequently so the potatoes heat evenly and do not adhere to the bottom of the pot. Once simmering begins, continue cooking for 1 minute.
Remove the pot from the heat and allow the potato-and-cream mixture to cool for 10 minutes.
Using a slotted spoon, arrange one-third of the simmered potato slices in an even layer across the prepared baking dish. Scatter one-third of the shredded Gruyère over the potatoes.
Add a second layer using another one-third of the potatoes, followed by another one-third of the Gruyère.
Finish with the remaining potato slices. Pour the cream mixture left in the pot evenly over the assembled potatoes, then distribute the remaining Gruyère across the surface.
Spray a sheet of foil with nonstick cooking spray and use it to cover the baking dish. Bake for 40 minutes.
Carefully remove the foil and return the dish to the oven for another 20–30 minutes, or until a knife slides easily through the potato slices.
For a more deeply browned surface, broil the scalloped potatoes for 1–2 minutes, if desired.
Allow the finished dish to rest for 20–30 minutes before serving. This resting period helps the creamy layers settle and makes the potatoes easier to portion into neat servings.