I've worked on farms for just over a decade now, and tail-docked and castrated hundreds of lambs.
It should be done within 7 days of birth, after that it should be done surgically.
With tail-docking, it's mainly to do with easier management and long-term welfare. It's generally done on sheep in the lowlands where the grass is richer, and more likely to give the sheep the runs.
The tail would be right in the firing line - and in the summer, blowfly lay their eggs in the dirty fleece. The maggots hatch out, and if untreated will slowly eat the sheep alive.
They don't have the whole tail removed: ewe lambs should still have enough to cover the vulva, and ram lambs to cover the anus. That way any flies can be batted away from the sensitive areas!
With castration, it used to be about flavour - testosterone is said to "taint" the meat making it less palatable. Though I'm not sure how true that is in young animals, as we hardly ever used to eat lamb.
The fleece used to be worth more than the meat, so only older animals would have been eaten. (I think a ransom for King Richard was paid in English fleece at one point, it was that valuable)
Castration also makes management easier too - if you've got loads of "entire" arms in the flock, after several months you'll need somewhere else to keep them to stop them all mating? If they're castrated they can be kept with the ewes.