you can take as long as you like but you won't be able to drive the car until it has had the work done and passed the test and if your tax ran out, you wouldn't be able to renew to tax either.
If you leave the car at the garage that did the original test, it can have a free re-test up to 10 days after the original. If you take it away and get the repairs done elsewhere, you can take it back to the first garage for a half price test up 10 days after the original test. The garage of course may offer free retests anyway as a marketing ploy.
Well thats what Wikipedia says anyway...