I generally let it go 24 hours or until I get an error. When I tested the stability of my desktop OC when I was building it and then burning it in, I ran P95 WHILE FOLDING for 28 hours without error.
I like to do 24 hours of dual instances of Prime95 running Small FFT's for CPU.
For RAM I do 10+ hours of Memtest Test #5 looped and then the same thing for Test #8 and then 1000% of Memtest for Windows.
For GPU 30 minutes of ATITool artifact tester running old scanning method.
there used to be a guide on how to use Prime95 for stress testing. Basically you should:
1) put in password "9876"
2) set priority to 10 <pretty much renders your computer useless for the duration
3) use Large FFT's <Creates the most heat and stresses the CPU the most.
....run it for 24+ hours. I usually run it for 48 hours since it actually detected an error at the 29th hour of testing once.
If you want a quick validation of a "should be ok" setting then I think 4 hours is ok, but for complete security and confidence with a very new config, then 24 hours is pretty standard.