Ulamaa ID 13
Bismillahir Rahmaanir Raheem
Al Jawaab Billahit-Tawfeeq
Although it is more rewarding to perform Tahajjud after waking up from sleep, it can be prayed before sleeping as well.
It can be prayed anytime after Esha Salah until Fajr time starts, however, it is better to pray it during the later portion of the night. (See Fatawa Mahmudia, Page 349)
And Allah knows best