I have managed to find a couple of golden wizard's hats in various levels of LEGO Harry Potter Years 5-7. I never manage to find all the ones in a level, though, which made me wonder if they were actually important, and if I should be spending more time looking for them. What do they do?
I believe they unlock still frames of art, which you can access in a particular location in the mission select/hub area.
Finding all of the gold wizard hats in a level opens a "model" in the trophy room at the hub.