Preheat oven to 350°F and butter a 9x13-inch or 4-quart baking dish with 1 tablespoon unsalted butter.
Grate Gruyère cheese using the large holes of a box grater.
Peel and slice Yukon Gold potatoes into 1/4-inch rounds and place in a large pot.
Add minced garlic, heavy cream, whole milk, kosher salt, black pepper, nutmeg, and bay leaves to the pot.
Bring mixture to a simmer over medium heat, stirring frequently, and cook until potatoes are fork tender but still firm, about 5 to 7 minutes.
Remove and discard bay leaves.
Using a slotted spoon, transfer half the potatoes to the buttered baking dish in an even layer.
Sprinkle half of the grated cheese evenly over the potatoes.
Layer the remaining potatoes over the cheese evenly.
Pour about 2 cups of the cream mixture over the potatoes, stopping just below the top layer.
Top with the remaining cheese.
Bake in the oven until golden brown and a knife easily pierces through to the bottom, 40 to 45 minutes.
Garnish with fresh thyme leaves and let cool on a wire rack for at least 15 minutes before serving.