Preheat oven to 375°F (190°C).
In a medium saucepan over medium heat, melt the butter. Once melted, add the flour, ranch, salt, and pepper. Cook for 1 minute, whisking constantly.
Slowly drizzle in milk, whisking constantly. After adding the milk, continue cooking until the mixture thickens, 3-5 minutes, whisking frequently.
Remove from heat. Stir in half of the cheddar cheese and half of the mozzarella cheese. Continue stirring until the cheese is melted, about 30 to 60 seconds. Set aside.
Set the potato slices in the bottom of a large, 12-inch oven-safe skillet (trying to keep the shape of the potato together), fanning them out in a single layer.
Sprinkle most of the ham evenly over the top of the potatoes, reserving about 2 tablespoons for the topping.
Pour the cheese sauce over the top. Then, top with the remaining cheeses and reserved ham.
Cover the dish with aluminum foil or a tight-fitting lid. Bake for 70-80 minutes. Remove the foil and bake for 8-10 more minutes, or until the potatoes are tender when pierced with a fork.
Broil for an additional 2-3 minutes, or until the top is bubbly and golden brown. Watch closely to avoid burning.
Remove from the oven and let the dish cool slightly. Garnish with chopped chives. Add salt and pepper to taste.