Praise be to Allah.
It is better for circumcision to be done when the child is small, because that is kinder to the child, and so that the child may grow up in a perfect form.
It is mustahabb for the child’s guardian to have him circumcised when he is small, because that is kinder to him.
Al-Bayhaqi (8/324) narrated that Jaabir said: The Messenger of Allaah (peace and blessings of Allaah be upon him) did ‘aqeeqah for al-Hasan and al-Husayn, and he circumcised them when they were seven days old.
The isnaad of this hadeeth is da’eef (weak). See Irwa’ al-Ghaleel, 4/383
Hence Imam Ahmad was asked about the time of circumcision, and he said, We have not heard anything about that.
Ibn al-Mundhir said:
There is no report that may be referred to concerning the time of circumcision, and no Sunnah to be followed.
With regard to the time when it becomes obligatory:
Some of the scholars were of the view that it is not obligatory until after puberty, because the duties of sharee’ah are not obligatory until one reaches puberty.
Our companions said: The time when circumcision becomes obligatory is after puberty.
Ibn al-Qayyim (may Allaah have mercy on him) favoured the view that it is obligatory before puberty, so that the child will reach puberty in a circumcised state, but the obligation here is upon the guardian, not the child.
Ibn al-Qayyim said:
In my view it is obligatory for the guardian to circumcise the child before puberty, so that he will grow up in a circumcised state, because the duty can only be done in this manner… The Prophet (peace and blessings of Allaah be upon him) enjoined fathers to tell their children to pray when they are seven and to smack them if they do not pray when they are ten, so what justification can there be for not circumcising them until after they have reached puberty?
Shaykh al-Islam Ibn Taymiyah said:
With regard to circumcision, whenever he wants he can be circumcised, but if he is approaching the age of puberty he should be circumcised as the Arabs used to do, to make sure he does not reach puberty when he is not circumcised.
Al-Fataawa al-Kubra, 1/275.