What is qiyam al-layl? Qiyam al-layl means spending the night, or part of it, even if it is only one hour, in prayer, reading Quran, remembering Allah (dhikr) and other acts of worship. It is not stipulated that it should take up most of the night.
It says in Maraqi al-Falah: "What is meant by qiyam is spending most of the night in worship, or it was said: spending one hour of it, in reading Quran, listening to hadeeth, glorifying Allah (tasbeeh) or sending blessings upon the Prophet (blessings and peace of Allah be upon him)." (Al-Mawsoo'ah al-Fiqhiyyah al-Kuwaitiyyah, 34/117)
What is Tahajjud? Tahajjud means specifically praying at night, and some scholars limited it to prayers that are offered at night after sleeping.
Al-Hajjaj ibn 'Amr al-Ansari (may Allah be pleased with him) said: One of you thinks that if he gets up at night and prays until morning comes that he has done tahajjud. But in fact, tahajjud means praying after sleeping, then praying after sleeping.
That is how the Messenger of Allah (blessings and peace of Allah upon him) prayed. Al-Hafiz Ibn Hajar said in al-Talkhees al-Habeer (2/35): "Its isnad is hasan; it includes Abu Salih, the scribe of al-Layth, and it is somewhat weak. It was also narrated by al-Tabarani, whose isnad includes Ibn Luhay'ah, whose report is supported by the one that came before it."
Difference between tahajjud and qiyam al-layl
Thus it becomes clear that qiyam al-layl is more general than tahajjud, because it includes prayer and other actions, and it includes prayer before and after sleeping.
But Tahajjud is exclusively praying, and there are two opinions concerning it. The first is that it means praying at any time of the night, which is the view of the majority of fuqaha.
The second is that it is prayer after sleeping. (Al-Mawsoo'ah al-Fiqhiyyah, 2/232)
Al-Qurtubi (may Allah have mercy on him) said in his commentary on the verse (interpretation of the meaning): "And in some parts of the night offer the Salaah (prayer) with it (that is, recite the Quran in the prayer) as an additional prayer (Tahajjud optional prayer Nawafil) for you (O Muhammad)."
"It may be that your Lord will raise you to Maqam Mahmud (a station of praise and glory, i.e., the honour of intercession on the Day of Resurrection)" [al-Isra 17:79]:
Tahajjud comes from hujood, which is doing one thing and the opposite, so the word hajada may mean he slept or it may mean he stayed up at night, which are opposites.
Tahajjud means waking up after sleeping, and it became a name for prayer, because the individual wakes up for it. So tahajjud means getting up to pray at night. This meaning was given by al-Aswad, 'Ilqimah, 'Abd al-Rahman ibn al-Aswad and others.
Ismaa'eel ibn Ishaq al-Qadi narrated from the hadeeth of al-Hajjaj ibn 'Amr, the Companion of the Prophet (blessings and peace of Allah upon him) that he said: Does one of you think that if he gets up and spends the entire night in prayer that he had prayed tahajjud? Rather tahajjud is praying after sleeping, then praying after sleeping, then praying after sleeping. This is how the Messenger of Allah (blessing and peace of Allah be upon him) prayed.
And it was said tahajjud means sleep, as it is said in Arabic, Tahajjada al-rajul, meaning the man stayed up, and alqa al-hujood, i.e., sleep. And the one who gets up to pray is called mutahajjid." ( Tafseer al-Tabari, 10/307)
Difference between Taraweeh, Qiyam and Tahajjud
Shaykh Ibn Baz (may Allah have mercy on him) was asked: What is the difference between Taraweeh, Qiyam and Tahajjud? Please advise us, may you be rewarded.
He replied: "Prayer at night is called tahajjud or qiyam al-layl," as Allah says (interpretation of the meaning).
"And in some parts of the night (also) offer the Salah (prayer) with it (i.e. recite the Quran in the prayer) as an additional prayer (Tahajjud optional prayer Nawafil) for you" [al-Isra' 17:79]
"O you wrapped in garments (i.e Prophet Muhammad)! Stand (to pray) all night, except a little" [al-Muzzammil 73:1-2]
"They used to sleep but little by night [invoking their Lord (Allah) and praying, with fear and hope]" [al-Dhaariyaat 51:17].