It should cope just fine. E.g. Leave it running for 5 years.
Prime95 is a VERY good example, because some of the people who want to be the first, to find a new giant prime number (mersenne prime), do exactly what you describe.
Really, the above is what prime95 is for, searching for big (mersenne) prime numbers, the cpu stress testing is a by product of that work.
So I assume overclocking is a big NO-NO if you're going to use Prime95 for the intended purpose. I mean, if an overclocked system is stable for 100 days, all you really know is that it's stable for 100 days. Maybe it would have produced errors two minutes into day 101...and all your work up until that point would have been wasted.
24 hours seems to be about the longest most overclockers can be bothered to run it as a stress test. Tying up your main computer for longer than that is really not practical.
