It's a 4chan meme I believe. Not sure though, as like with all 4chan memes (All ur base R belong to us, Rickrolling, orly, ur mom, etc.) they are pretty hard to trace as to where exactly they were first used. But everyone uses it nonetheless because it's pretty 1337. Like uber11!!!1!
Hammer time is used most often to break a serious case of srsbzns. When people are starting to sound like ur mom, you put out your hands like this:
and yell 'It's hamma time!!!'. As you can see, this posture is a little bit of a derivative of a more familiar internet contortion known as jazzhands. Though the most frequent follow-up is not actually hammer time, but what can be more accurately described as "peanut butter jelly time with a baseball bat". And no, it's not some sort of christian magic. It's because you wiggle like this and waggle like that. As to approximate the wild gyrations of a banana dancing to a rap song. The desired effect is to shatter all illusions of srzbsns and induce facepalms.