Quran Says:
وَوَصَّيْنَا الْإِنْسَانَ بِوَالِدَيْهِ إِحْسَانًا حَمَلَتْهُ أُمُّهُ كُرْهًا وَّوَضَعَتْهُ كُرْهًا وَحَمْلُهُ وَفِصَالُهُ ثَلَاثُوْنَ شَهْرًا حَتَّى إِذَا بَلَغَ أَشُدَّهُ وَبَلَغَ أَرْبَعِيْنَ سَنَةً قَالَ رَبِّ أَوْزِعْنِیْ أَنْ أَشْكُرَ نِعْمَتَكَ الَّتِیْ أَنْعَمْتَ عَلَيَّ وَعَلَى وَالِدَيَّ وَأَنْ أَعْمَلَ صَالِحًا تَرْضَاهُ وَأَصْلِحْ لِیْ فِیْ ذُرِّيَّتِیْ إِنِّیْ تُبْتُ إِلَيْكَ وَإِنِّیْ مِنَ الْمُسْلِمِيْنَ. أُوْلَئِكَ الَّذِيْنَ نَتَقَبَّلُ عَنْهُمْ أَحْسَنَ مَا عَمِلُوْا وَنَتَجَاوَزُ عَنْ سَيِّئَاتِهِمْ فِیْ أَصْحَابِ الْجَنَّةِ وَعْدَ الصِّدْقِ الَّذِیْ كَانُوْا يُوعَدُوْنَ.
“[If you want to understand how people become thorough and become unjust to their souls, then listen:] We have enjoined a human being to show kindness to his parents. With great difficulty, his mother carried him in her womb, and with great difficulty delivered him and his carrying and weaning took place in [almost] thirty months. Finally [after passing through all these stages] when a human being fully matures and becomes forty years old [17] he prays: “God give me the urge to express gratitude for your favour which you did to me and to my parents and do those righteous deeds which please you. And also create kindness for me in my children. I turn to you and indeed I am from among the obedient.” It is these people whose good deeds We shall accept from them and whose vices We shall overlook so that they be among the dwellers of Paradise. This is a true promise which has continued to be made with them”. (Quran 46:15-16)
(Excerpt from Quranic Exegesis: Javed Ahmed Ghamidi)
(Translated by Dr. Shehzad Saleem)
___________________
[17]. This is the maximum age attaining which a person must get control of his whims and desires and should reach the mental maturity which is required by his creator. It is evident from this that if a person passes away before this age, he can expect some concession from his creator.