Preheat oven to 350°F.
In a large Dutch oven, melt butter over medium-high heat, about 1 minute.
Sauté onion until softened and lightly browned, about 4 minutes.
Add garlic and cook until fragrant, about 30 seconds.
Add cream, milk, thyme, bay leaf, salt, pepper, and potatoes.
Bring to a simmer, cover, and maintain a gentle simmer.
Cook until potatoes are nearly tender, about 15 minutes.
Discard thyme and bay leaf. Transfer to a 3-quart gratin dish.
Sprinkle with cheese. Bake until cream thickens and top is golden brown, about 20 minutes.
Let rest for 5 minutes before serving.