One of the meanings of the word Tahajjud is to give up sleep. In the religious sense it means to wake up in the later part of night to pray Nafal prayers. Tahajjud was prescribed in the initial period of Islam which is also known as Meccan Period.
Most people confuse Qiyam ul Layl and Tahajjud. Qiyam ul layl is more general of the two and can include praying salah as well as other zikr. It can also be before sleeping or after it. However tahajjud is exclusively praying. There is difference of opinion regarding tahajjud. Some fuqaha are of the view that tahajjud only applies to praying after sleeping. However most fuqaha believe that it means praying at any time regardless of sleeping or not.