Heat a large skillet over medium heat. If using bacon, add to skillet and cook until crisp and fat has rendered. Scoop out the bacon to a paper towel-lined plate. Remove all but a tablespoon of fat.
If not using bacon, heat olive oil in a large skillet over medium heat.
Add shallot and garlic and sauté, stirring often until starting to soften about 3 minutes. Add mushrooms and continue to cook until most of the moisture has cooked out about 8-10 minutes.
Add wine, thyme, salt and pepper and cook until wine has cooked out about 3 minutes.
Stir in cream cheese, 1/2 cup of gruyere and bacon (if using).
Preheat oven to 425℉ and lightly spray a 4 3/4"- 5 3/4" x 14" tart pan with removable bottom. Fit puff pastry into tart pan and trim the top so it is level with the pan. You will need to cut the puff pastry sheet in two pieces to make it fit.
Spread filling evenly into pastry shell and sprinkle with remaining 1/2 cup of grated gruyere. Bake for about 25 minutes until golden and filling is bubbly.
Allow tart to rest for a couple of minutes prior to removing the outer pan. Cut into wedges, garnish with fresh thyme and serve immediately.
The tart can be assembled up to a day in advance and kept covered and chilled until ready to bake.