its really up to you. a good rule of thumb is the longer the better!!! but, not everyone is willing to wait that long... sometimes your ok sometimes your not.
i had a little 10 gal. that i was keeping a bunch of tropical fish in. One day at the store i fell in love with this angel fish.... as it turns out s/he had ick and it killed all but one fish in my tank.
thats how i learned my lesson. therefore i Q everything that lives plants feeder fish shrimp. or i grow my own, i started a worm farm i know what i put into the farm therefore i know what the worms are eating and if they are dying or not.
but i would quarantine at the minimum 14days, also thats how long most fish stores garentee their product.
Good luck!