For me, the time usually occurs when I am struggling to finish a book and I feel "stuck." It also happens when I read a really good book and question my talent in comparison to the talent of the author I'm reading.
It also happens when I really tired.
But I know that these moments of doubt will be short-lived, and my mind will straighten itself out again eventually. It's all a part of the profession that I have chosen. No, correction, the profession that chose me.
So I will muddle on, and try my hardest to be patient. I will continue writing, and when the current project is complete, I will look back on these troubled times and realize I was just being over critical.