There are also programming breaks of a different variety. Those that are measured in days instead of hours.

When I've been hitting my head against a problem for about a week I take a few days off of working on that program (or that part of the program). I've found that after a few days you'll either be rested enough to attack the problem again or the solution will have already come to you (for me, it usually happens while I'm driving).

Note: This generally applies to projects being done for fun not for work, with deadlines and such. Although even with deadlines, it is still helpful to take a break from a specific problem and work on something else, unless that's the last thing there is.