Preheat your oven to 400 degrees. This is crucial for achieving that beautiful golden crust on top of your gratin.
In a small pot, combine the heavy cream and minced garlic. Bring it just to a simmer over medium heat, then remove it from the heat to let the flavors meld together. Stir occasionally to prevent a skin from forming.
Meanwhile, butter a 9×13-inch shallow casserole dish or a similar gratin dish. This will help prevent the gratin from sticking and give it a lovely buttery flavor.
Now, start building your gratin. Begin by layering one quarter of the sliced sweet potatoes in the dish, spreading them out in a single, overlapping layer. This ensures even cooking and flavor distribution.
Sprinkle this layer with one-third of the kosher salt, fresh ground black pepper, and chopped thyme. Follow this with about half a cup of the shredded Gruyère cheese. This layering approach adds depth and richness to the dish.
Repeat the process with another quarter of the sweet potatoes, adding another one-third of the seasonings and half a cup more of cheese.
For the third layer, use half of the remaining sweet potatoes and once again sprinkle with the final one-third of the seasonings and half a cup of Gruyère cheese. You should have about half a cup of cheese left for the topping.
Finish with the last of the sweet potatoes to create a final layer on top. Now, stir the cooled garlic cream mixture and pour it evenly over the gratin, ensuring the top layer of potatoes is well covered.
Gently shake the dish to distribute the cream mixture. Top with the remaining Gruyère cheese for that irresistible cheesy crust.
Cover the dish with foil and place it in the middle of the oven. Bake for 30 minutes. This helps cook the potatoes through before browning the top.
After 30 minutes, remove the foil and move the gratin to the top third of the oven. Bake uncovered for an additional 20 minutes or until the top is beautifully browned and the potatoes are tender when pierced with a sharp knife.
If you desire an even deeper coloration, feel free to place it under the broiler for a few minutes, but keep a close watch to avoid burning!
Once done, remove the gratin from the oven and allow it to cool for 30 minutes before slicing. This resting time helps it set, making it easier to serve.