The timing of orchidopexy is a balance between two opposing facts. On one side, an undescended testis can still drop on its own during early infancy, so operating right at birth would mean cutting many babies who would have corrected themselves. On the other side, a testis left hot inside the abdomen suffers progressive harm to its sperm-forming cells and faces a higher cancer risk, so waiting too long is damaging.
Spontaneous descent essentially stops by around 6 months of age. After that there is nothing to gain by waiting, and every month adds heat injury to the germ cells. The classic teaching point, and the answer this question wants, is to complete surgery by about 1 year, that is 12 months, with many modern guidelines fixing the surgery between 6 and 12 months.
So 'just after birth' is premature, and 21 months is dangerously late. Settling the testis into the cool scrotum by the first birthday gives the best shot at preserving fertility and at making the testis easy to examine for tumour later.
Therefore the best time for orchidopexy is 12 months of age.
\[\boxed{\text{12 months of age}}\]