All merchants hang around for roughly 1.5 to 2 months, although there are other factors that can cut into your trading time: If it takes a loooooong time for the merchants to get from the edge of the map to the Trade Depot, or if it takes a loooooong time for the merchants to get everything unloaded for sale (which can happen if you asked for everything during your previous meeting with the liason), then that's subtracted from the period during which you can make transactions. Loading time is also a factor when they leave: If you sold them a ton of cheap items as opposed to a few expensive ones (or stackable ones in bins), it's going to take forever for the merchants (the caravan guards don't help) to get everything packed away on their animals. But that delay is on the merchants' dime, not yours.
In your first year or two, you're very likely going to be scraping and wheedling the merchants for every last scrap of goods you can squeeze out of them, but as your economy gets rolling, you'll find that you're producing one hell of a surplus (in some things if not others), and you'll be all too happy to load the merchants down with quality wares at drastically slashed prices, just to free up some room in your cramped stockpiles. ("Let's see, the liason said you wanted . . . footwear, scepters, harps, leather waterskins, and thread. Hope you like these 40 large orthoclase pots full of plump helmet roasts!")
Watch your weight limits: Early merchants may bring only 1 or 2 pack animals, who won't be able to carry much extra mass. Building furniture is a great way to keep your dwarves happy, train up your Mason, get rid of excess stone, and produce trade goods all at the same time, but if the poor mule can only take another 2 chairs and a door, you're pretty much screwed. Produce some lightweight crafts as well to open up another income stream, and/or be prepared to buy things for which you have no immediate need: Cheap but heavy stuff like clay, or empty lead cages.
I have heard that as your economy improves more & more, merchants start using wagons to haul their products, instead of pack animals. (I've never seen this for myself, but my best fort is only at the end of Year 4.) While pack animals can pass doors & bridges only 1 tile wide, I hear wagons require an uninterrupted path that's never narrower than 3 tiles. You may eventually need to widen the gap in your defenses, or build a (temporary) Trade Depot that's more exposed than you might like.
[ADD:] Merchants and their entourage can traverse ramps, but not stairs.