A Brahmin child's upanayana must be performed when he is eight years old from conception, that is when he is seven years and two months old from birth. A Ksatriya's is to be performed at the age of twelve. Krsna Paramatman who belonged to the clan of Yadus (Yadavas) was invested with the sacred thread at that age. The corresponding age for a Vaisya is sixteen.
According to the sastras, the lower limit of Brahmin youngsters is eight years and the upper limit is sixteen which means a grace of eight years. It is sinful in the not to have performed upanaya of a Brahmin boy before his passing the upper age limit.
Uttarayana is the right period to perform upanayana- from the Tamil month Tai to Ani. when the sun journeys northwards. While this is the right time for marriages also, the season of spring(Chittirai to Vaikasi)is considered particularly auspicious. For upanayana the month specially favoured is Masi. Upanayana and marriage are not favoured during Daksinayana(from the Tamil month Adi to the end of Margazhi).
Nowadays, for various reasons, the upanayana and marriage ceremonies are delayed for as long as possible and celebrated in any month other than Margazhi. The results are there for you to see. But one must be happy perhaps that a function called marriage is still performed somehow. So long as people perform it, let them perform it at any time. If we take this attitude, marriages may be permitted in any season as a desperate step. But upanayana is a different matter. It should never be permitted in Daksinayana. If it is for some reason celebrated during this period, I would ask for its performance again in Uttarayana. Money is the main problem in conducting an upanayana or a marriage. Parents postpone the upanayana because they want to perform it at the same time as the marriage of their daughter so as to minimise the expenses.
The upanayana is sometimes performed when the boy is only five years old. This is called "kamyopanayana", "Kamya" meaning in persuance of desire. Such early upanayana is all right if you want the child to develop inwardly at an early age. But seven years is the proper age for the child to be invested with sacred thread because by now he would have learned enough Sanskrit to chant the mantras clearly. Nowadays, the "thread ceremony" is conducted together with the marriage, that is when the "boy" is 30 or 35 years old. So to suggest that the upanayana needs to be performed only when the child is seven years old - and not at five - would be taken as a joke. Joke or no joke, it [the delay in performing the upanayana] should make you uneasy deep within if you have some concern for the vedic dharma.
Adi Sankara's upanayana, it is believed, was performed when he was five years old. If the child is extraordinarily intelligent and can articulate words properly, his upanayana may be performed at five years.
For a general background, please see here