One of best ways to blow someone's winning streak during a tennis game is to comment on how great they are doing. Your comment will kick in their left brain's inner critic which will zap their flow and change their focus. In tennis, this is an underhanded type of gamesmanship.
In life, it happens to each of us all time. Even to writers.
In writing, same thing occurs as soon as right side of brain, right hemisphere, gets a break, left side begins editorializing. Even if left side compliments you on your progress or time you committed, it still zaps flow. Flow stops, hiccups, and writing or idea doesn't get to next step.
This is an event that affects us all in more than just writing.
There is not any particular timeframe when this occurs either. It may occur when you are writing something short, like an article, memo, or email. Or it might not occur until chapter six of your book. This is why freewriting exercise works so well. It allows your right brain to tell left side to shut up for a particular amount of time.
There is actually only one way to get writing flowing again. It is by doing something unfamiliar. When you are doing something unfamiliar left side doesn't know how to logically respond. The left side then can't be its helpful self. Flow, intuition, and ideas naturally return with a renewed rhythm.