Preheat the oven to 350ºF and coat a 13x9 baking dish with 1 tablespoon of butter or cooking spray; set aside.
In a large deep skillet over medium heat melt the remaining 1 tablespoon of butter and olive oil. Add the sliced onions and season with salt and pepper. Stir occasionally, until the onions are coated evenly and begin to sizzle, about 2 minutes.
Pour the wine and add the bay leaves to the skillet and reduce the heat to medium-low. Cover and continue to cook, stirring occasionally until the onions become tender about 20 minutes
Remove the cover and increase the heat again to medium-high, making sure the liquid evaporates and onions are golden brown, about 10 minutes. Add 2 tablespoons of water to deglaze the pan and use a wooden spoon to scrape the bits off the bottom. Discard the bay leaves and set aside.
In a large pot or Dutch oven bring the potatoes, heavy cream, milk, and garlic to a simmer. Season with additional salt and pepper. Leaving the lid ajar let the potatoes simmer until just tender and the liquid has thickened about 10 minutes.
Using a slotted spoon, place 1/3 of the potatoes into the prepared dish and spread them in an even layer. Sprinkle 1/3 Gruyère cheese on top and cover with 1/2 of the caramelized onions. Repeat the layering and finish with the remaining 1/3 cup Gruyère cheese. Pour the cream mixture over the entire dish.
Cover the potatoes tightly with foil and bake for 35 minutes. Remove the foil and continue to bake for an additional 30 minutes longer until the top are golden brown.