A beer ferments for as long as it needs to. And you determine if it's done by taking a couple of grav readings a couple days apart. You don't arbitrarily decide how long you want a beer to ferment for. You don't say "I am going to ferment this for 7 days." The yeast don't read calendars, and have their own agendas. Some yeasts can take 72 hours before it even starts, so if you arbitrarily rack or bottle your beer on day 7 without making sure fermentation is complete, then you can have stuck fermentation or bottle bombs. Because at 4 ACTUAL days of fermentation, the beer probably isn't finished yet....
Now conditioning time, the time AFTER fermentation is complete is up to you. Many of us leave our beers in primary for a month, to let the yeast clean up the byproducts of fermentation, and clear the beer. Others opt for a secondary. If I am recomending someone secondary, I suggest that they take their first reading on day 12 and again on day 14 then rack the beer to a secondary for a minimum of 2 weeks, or longer depending ont he graivty of the beer.....
But this is NOT the same thing as saying "How long is my beer fermenting for" because it is only fermenting for as long as the yeast needs to....