Here on Meta.SE I received the I Have A Little Dreidel hat when I got an upvote on this question last night, before I did anything - the first thing that I did on SE was go to the Puzzling, and then I clicked on notifications. When I clicked on the hats, I saw that I had earned IHALD on Meta.SE, after getting an upvote. I didn't do anything. Yet I received the hat.
You do not get the hat just for being upvoted. You have to make an active contribution to the site.
The probable source of your confusion is that because of a bug, the Dreidel hat wasn't awarded when intended (December 23th, 10am UTC). Shortly after the fix was made, the hats were awarded retroactively. So there could be 24 hours between the trigger and the awarding of the hat, instead of the normal 10 minutes maximum.