Abu Bakra reported,

I would not seek it, based on what I heard from the Messenger of Allah ﷺ, except in the last ten nights, for I heard him say, "Seek it when nine nights remain, or when seven remain, or when five remain, or when three remain, or on the final night."The narrator said, Abu Bakra used to pray during the first twenty nights of Ramadan as he prayed throughout the rest of the year, but when the last ten nights began, he would exert himself in worship.

Tirmidhi 794

Sahih

حدثنا حميد بن مسعدة حدثنا يزيد بن زريع حدثنا عيينة بن عبد الرحمن قال حدثني أبي قال ذكرت ليلة القدر عند

أبي بكرة فقال

ما أنا ملتمسها لشيء سمعته من رسول الله ﷺ إلا في العشر الأواخر فإني سمعته يقول التمسوها في تسع يبقين أو في سبع يبقين أو في خمس يبقين أو في ثلاث أو اخر ليلة قال وكان أبو بكرة يصلي في العشرين من رمضان كصلاته في سائر السنة فإذا دخل العشر اجتهد

الترمذي 794صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Fasting
Chapter
Laylat al-Qadr
Numbering
Darussalam 794
Tirmidhi 794