Peel and finely chop the garlic. Peel potatoes, wash and cut lengthwise into very thin slices. Mix with garlic, oil, 1 tsp salt and 1/2 tsp pepper in a bowl. Pluck ham a little bit smaller.
Grate cheese. Divide the potatoes and ham into 4 ovenproof moulds (each containing approx. 300 ml). Sprinkle cheese on top. Place the moulds on the oven rack, cover with aluminium foil and bake in the preheated oven (electric range: 175 °C/ convection oven: 150 °C/ gas: level 2) for approx. 50 minutes.
Remove foil and bake potatoes for another 15-20 minutes until golden brown.