Step 1Heat the oven to 350 degrees. Oil a 2 1/2- to 3-quart gratin or baking dish.
Step 2Remove the stems from the chard, saving the stems. Tear the leaves into large pieces.
Step 3Cut the leek into thin circles, place in a colander, and wash well to remove any dirt. Chop up the garlic and the chard stems and combine with the leek. Sprinkle the mixture over the bottom of the gratin dish, drizzle over a little olive oil, ¼ teaspoon salt and several grinds of pepper, or to taste.
Step 4Peel the butternut squash and quarter lengthwise, then cut each quarter crosswise into 1/4-inch thick slices. Cut the potatoes crosswise into 1/4-inch slices. Place the squash and potatoes in a bowl, toss with 1 to 2 tablespoons oil to lightly coat each piece, and season with ¾ teaspoon salt and several grinds of pepper, or to taste.
Step 5Begin layering the gratin: Place a layer of chard leaves, then a layer of squash, then a layer of chard, followed by a layer of potatoes. Repeat, alternating the squash and potatoes with the chard.
Step 6Cover the gratin dish with foil and roast for 30 minutes, then remove the foil and continue roasting until the vegetables are tender and lightly colored on top, 30 to 40 minutes more. When the gratin is almost done, sprinkle over the cheese and continue cooking until the cheese is melted. Remove and cool slightly before serving.