1 - Caramelize onions - Adjust oven rack to middle position and heat oven to 350 degrees. Melt butter in large non-stick skillet over medium-high heat. Add onions and 1 teaspoon salt and cook until just beginning to brown, about 5 minutes. Stir in brown sugar and cook, stirring frequently, until onions are golden brown, about 5 minutes. Add 1/3 cup broth and cook until softened and deep golden brown and sticky, about 5 minutes. Transfer caramelized onions to medium bowl.
2 - Deglaze pan - Bring remaining broth, wine, cream, and remaining salt to boil in now-empty skillet, scraping up any browned bits. Off heat, stir in vinegar; cover and keep warm.
3 - Assemble gratin - Shingle half of potatoes in 3-quart baking dish; sprinkled with half of the thyme and 1/2 teaspoon of pepper. Spread caramelized onions over potatoes and top with remaining potatoes, remaining thyme, and remaining pepper. Pour broth mixture over potatoes.
4 - Add cheese - Bake until bubbling around edges, about 30 minutes. Top with Gruyere and bake until gratin is golden brown and fort inserted into center meets little resistance, 30 - 40 minutes. Let cool for 15 minutes. Serve.