For me its based on progress; if a project is going well and I am constantly being presented with new challenges it does not get boring. If that is not the case then (e.g.: not growing and no progress) then i quit. Quitting is not always a bad thing. I highly recommend a book called "The dip". It may help you understand when its time to call it quits on a particular project.