Preheat oven to 400° F. Grease a 2-quart baking dish; set aside.
In a large skillet, melt the butter over medium heat. Whisk in the flour and garlic; cook for 1 minute. Gradually whisk in the milk and cream; cook, whisking, until thickened, another 2 minutes or so. Add the thyme, salt, pepper, nutmeg, half of the cheddar and half of the Gruyere. Whisk for about 1 more minute, making sure that all of the cheese is melted. Taste and season with additional salt and pepper, if necessary.
Arrange half of the potatoes in the prepared baking dish. Season with a little bit of salt. Pour half of the sauce over top. Arrange the remaining potatoes on top, season with another pinch of salt, and pour the remaining sauce over all. Sprinkle with remaining cheese. Cover and bake for 50-60 minutes (or until the potatoes are just about tender), then uncover and bake until browned on top, an additional 15-20 minutes. Let cool slightly, then serve.
Use russet potatoes or another starchy potato (like Yukon Gold) for the best texture and the creamiest sauce.
Add finely-diced or thinly-sliced onions to the layers of potatoes in the dish if you'd like some onion flavor in the au gratin potatoes.
Au gratin potatoes and ham are a classic combination! Turn this easy side dish into an entrée by adding diced ham to the layers of potatoes.
Heavy cream is an essential ingredient, so do not substitute with half-and-half or additional milk.
Fresh thyme adds a lovely, savory touch to the dish. If you prefer, you can omit the thyme or substitute with other herbs that you enjoy. Good options include parsley, chives or rosemary.
Pick a flavorful, high-quality cheese for the best potatoes au gratin! If you can't find Gruyere, you can substitute with Swiss cheese, or just use additional sharp cheddar cheese.