Think about your weekend.
You leave work on Friday, drive home, have dinner, and relax. On the weekend, maybe you do some work around the house, travel a little, partake in some hobbies. Basically, you enjoy your time off work and find other things to do.
Now, how do you feel on Sunday night? How does the thought of driving into work Monday morning make you feel? Do you get a sick, sinking feeling in your stomach at the thought of having to spend the next five days pounding out code?
Or, after having had a nice refreshing weekend, are you looking forward to getting back into the office and tackling some of the problems that remained unsolved when you left on Friday? Do you look at Monday as a chance to review last week's code while refreshed and revigorated?
If the first scenario is you, then perhaps it's time to get out now. If programming doesn't continually challenge and intrigue you anymore, you're just not going to be happy doing it. Simple as that.
If, however, you are constantly thinking to yourself "I can't believe I get paid to do something I love", then there's no reason to ever quit.