The Messenger of Allah ﷺ said, "The pen has been lifted from three, from the sleeping person until he wakes, from the afflicted person until he recovers, and from the child until he grows up."
حدثنا عثمان بن أبي شيبة حدثنا يزيد بن هارون أخبرنا حماد بن سلمة عن حماد عن إبراهيم عن الأسود
أن رسول الله ﷺ قال رفع القلم عن ثلاثة عن النائم حتى يستيقظ وعن المبتلى حتى يبرأ وعن الصبي حتى يكبر
Sourcing, [hasan] Ibn Majah narrated it in the Chapter on Divorce, section on the divorce of the insane, the minor, and the sleeping person, no. 2041, and Nasai, no. 3462, from the hadith of Hammad bin Salama, with this wording. Ibn Hibban graded it sahih, no. 1496, as did Hakim, 2/59, on the condition of Muslim, and Dhahabi agreed with him. The hadith has supporting narrations, see no. 4400.