6 months, before any of his male 'undesirable' characteristics kick in....such as spending too long reading the local lamposts, cocking his leg every 40 paces, drooling and generally slobbering at every 'sexy' smell he gets to sniff lol !! If you are not going to breed from him, it will save his frustration in the long run and no risk of testicular cancer when he gets older.
My males dont cock their leg every 40 paces, you need to train them not to do so. There 'are' disadvantages for castration too........prostrate cancer is four times as likely in a neutered dog to one that isnt, urinary tract cancer also increases by double.
My breed is HPR I would wait until at least a year pref longer so that the dog is properly mature. Our first dog was entire for most of his life (neutered for prostate problems aged 12) our current two were a risk to themselves at 18 months so we got them done. Castration don't automatically stop the unwanted behaviours, you need training as well. IMO what castration can do if it is needed is make it easier for the dog to change their behaviour by removing one of the behaviour drivers.