I reckon the answer to that is as long as it takes to deplane/reboard them.
Sometimes though it takes a while to diagnose the problem, surely you don't let them off until you are sure it can't be fixed quickly. I can see how this may take 3-4 hours, especially when you consider 'the rule of threes', whatever time an engineer tells you multiply it by three...