It was narrated that Anas said:"The Messenger of Allah set the time for postnatal bleeding at forty days, except for one who becomes pure before that."
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ سَعِيدٍ، حَدَّثَنَا الْمُحَارِبِيُّ، عَنْ سَلاَّمِ بْنِ سُلَيْمٍ، - أَوْ سَلْمٍ شَكَّ أَبُو الْحَسَنِ وَأَظُنُّهُ هُوَ أَبُو الأَحْوَصِ - عَنْ حُمَيْدٍ، عَنْ أَنَسٍ، قَالَ كَانَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ وَقَّتَ لِلنُّفَسَاءِ أَرْبَعِينَ يَوْمًا إِلاَّ أَنْ تَرَى الطُّهْرَ قَبْلَ ذَلِكَ .
IbnMaja
The Book of Purification and its Sunnah • Hadith 649