As long as it's part of the same mesh as the body, select the head bone in pose mode, right click on the mesh, go into weight paint, paint the hat, then select that bone in pose mode and see if it moves now. That's kind of a quick explanation, but this tutorial probably does a better job:
http://www.youtube.com/watch?v=W_sfan8OchA
Some of the best tutorials under the animation section of blendercookie.com. Watching these are pretty inspiring because they show just how in-depth one can go into rigging and animation. I've seen everything from rigging pistons to jumping balls to spiders.
Animating Gingerbread men tutorials.