Melt butter in large Dutch oven over medium-high heat until foaming subsides, about 1 minute.
Add onion and sauté until it turns soft and begins to brown, about 4 minutes.
Add garlic and sauté until fragrant, about 30 seconds.
Add cream, milk, thyme, bay leaves, salt, pepper, and potatoes and bring to simmer.
Cover, adjusting heat as necessary to maintain light simmer, and cook until potatoes are almost tender (paring knife can be slipped into and out of center of potato slice with some resistance), about 15 minutes.
Remove and discard thyme sprigs and bay leaves. Transfer potato mixture to 3-quart gratin dish and sprinkle with cheese.
Bake until cream has thickened and is bubbling around sides and top is golden brown, about 20 minutes. Cool for 5 minutes before serving.