Until it is done. That means going by gravity not time. Wait until you no longer see any signs of fermentation, no bubbling airlock, no krausen on the surface (most of the time) then wait another couple of days. Take a hydrometer reading then. After that wait until the second day and take another reading. If the numbers are the same you can bottle.
For me I always go 2 weeks. Minimum would be about 7-10 days. If you really hover over the beer you might be able to rush it a day or so earlier.