(20) باب صَلاَةُ اللَّيْلِ مَثْنَى مَثْنَى وَالْوِتْرُ رَكْعَةٌ مِنْ آخِرِ اللَّيْلِ
Ibn 'Umar reported that a person asked the Messenger of Allah (ﷺ) about the night prayer. The Messenger of Allah (ﷺ) said:
Prayer during the night should consist of pairs of rak'ahs, but if one of you fears morning is near, he should pray one rak'ah which will make his prayer an odd number for him.
Reference: Sahih Muslim 749 a
In-book reference: Book 6, Hadith 177
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1632