2 tablespoons unsalted butter, plus more for pan
2 1/2 pounds yukon gold potatoes, unpeeled, scrubbed, thinly sliced
1 thick or 2 slimmer leeks, halved, washed, cut into 1-inch segments
2 cups heavy cream
Kosher salt and freshly ground black pepper
2 garlic cloves, minced
Leaves from 3 sprigs fresh thyme
1/2 cup plain breadcrumbs (panko or homemade are great here)
3/4 cup coarsely grated gruyère, comte, or baby swiss cheese
Heat oven to 350 degrees F. Generously butter an 8×12-inch or 3-quart baking dish.
Arrange small stacks of sliced potatoes on an angle, slightly fanned, in different directions filling the pan loosely. Tuck leeks, halved side up, between potatoes around the pan. In a medium saucepan, bring cream, 2 teaspoons kosher salt, many grinds of black pepper, garlic, and thyme to a simmer, stirring to ensure the salt dissolves. Pour hot cream mixture evenly over the pan, trying to get every potato and leek coated. Cover pan tightly with foil, place on a baking sheet to catch any drips, and bake for 30 minutes.
Meanwhile, melt 2 remaining tablespoons butter. Add breadcrumbs, salt, and pepper to taste and mix to evenly coat.
At 30 minutes, briefly remove pan from oven and remove foil. Sprinkle top evenly with cheese, then scatter with buttered breadcrumbs. Return to the oven without foil for 45 minutes, until potatoes are totally tender, the top is browned, and the edges are bubbly. [Insert a knife or skewer into potatoes to feel for crunch or resistance. Return to the oven if needed.]
Let cool for 10 minutes before serving hot.
Do ahead: Gratin can be assembled the day before and baked before a big meal. It can also be baked for 30 minutes (the foil-on portion) and cooled, finishing the baking time the next day. Gratin reheats well in a 350-degree oven. Leftovers keep in the fridge for 4 to 5 days.