Depends on my mood, but it usually takes a few minutes.
Whenever someone "tries" to distract me, I usually don't get distracted; if I do, I wasn't flowing. I keep my mind focused on my current work, and jot down a note about their problem. Then I tell them to come back in a few minutes/hours to discuss. Well, unless the problem is really small, in which case I can easily solve it without loosing focus.
There are, however, times when the problem people come to me with is more interesting than what I'm working on. In that cases I don't mind getting out of the flow at all.