Once a person asked Messenger of Allah ﷺ ﷺ about the night prayer. Allah's Apostle ﷺ replied, "The night prayer is offered as two Rakʿat followed by two Rakʿat and so on and if anyone is afraid of the approaching dawn (Fajr prayer) he should pray one Rakʿah and this will be a Witr for all the Rakʿat which he has prayed before."
أَنَّ رَجُلاً سَأَلَ رَسُولَ اللَّهِ ﷺ عَنْ صَلاَةِ اللَّيْلِ فَقَالَ رَسُولُ اللَّهِ ﷺ صَلاَةُ اللَّيْلِ مَثْنَى مَثْنَى فَإِذَا خَشِيَ أَحَدُكُمُ الصُّبْحَ صَلَّى رَكْعَةً وَاحِدَةً تُوتِرُ لَهُ مَا قَدْ صَلَّى