Preheat oven to 350 degrees. Toss together potatoes, sweet potatoes, apple, leeks, oil, and 1 teaspoon salt. Season with pepper. Transfer to a 9-by-12-inch oval baking dish, spread into a thin layer, and cover with parchment-lined foil. Bake for 15 minutes. Raise oven temperature to 400. Remove, uncover, and top with Gruyere. Bake until bubbling and top is browned, about 30 minutes.