Jubayr bin Nufayr narrates from Sayyiduna Abu Dharr (may Allah be pleased with him): We fasted Ramadan with the Prophet (peace and blessings be upon him), and he did not perform any night prayer (with us) during the month until the twenty-third night came. He (peace and blessings be upon him) stood in prayer with us until a third of the night. Then on the twenty-fourth night he (peace and blessings be upon him) did not stand in prayer, then on the twenty-fifth night he stood in prayer until half the night. We said: O Messenger of Allah! What if we were to pray voluntary prayer for the rest of the night? He (peace and blessings be upon him) said: "When a person stands in prayer with the imam, he receives the reward of the rest of the night as well." Then on the twenty-sixth night he (peace and blessings be upon him) did not stand in prayer, and on the twenty-seventh he stood in prayer, and he sent for his family, and the people gathered. We feared that we might miss even our suhur.
(b) Wuhayb narrates from Dawud: the twenty-fourth night, the seventh of those remaining; and he said: the twenty-sixth night, the fifth of those remaining; and the twenty-eighth night, the third of those remaining.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4610