Does a hammer toe hurt?

Maybe. If the deformity is severe enough it can hurt, or if the toe rubs on the shoe it will cause pain.
If it becomes. Arthritic and/or if a corn develops.
It can. People can get hammertoes several different ways, including just an unlucky roll of the genetic dice, but the fundamental result is usually the same: a toe that has drawn back and no longer sits straight or "flat", and sometimes this can be very painful, whether due to the underlying arthritis or a callus that forms due to the deformity.
They may or may not. Not all hammertoes will hurt. Pain usually will result from the use of ill fitting shoes.