You use a quarantine tank when 1) Getting new fish and 2) Taking care of sick fish.
When you have a new fish in a quarantine tank you leave it there for at least a week and monitor eating and behavior.
When you have a sick fish you put it there and add medication. Take out the chemical filtration in the filter if you have it.(I don't because it will serve no use to me if I'll have fish in there)

how long should you keep new fish in there? Do you always have one set up or just when you are expecting new fish?