Preheat oven to 350 degrees F (175 degrees C). Grease a 9x13-inch baking dish.
Stir hash browns, ham, Cheddar cheese, onion, cream of chicken soup, sour cream, and butter in a large bowl; season with salt and black pepper. Transfer mixture to prepared baking dish and cover with aluminum foil.
Bake until bubbly and cheese is melted, 45 minutes to 1 hour. Remove foil and continue baking until brown, about 15 minutes more.