Can one pray in pyjamas or any clothes he wears to sleep?
It is permissible to pray in clothes in which one has slept, so long as they are pure and cover the ‘awrah, although it is better and more perfect to wear beautiful clothes that look good for prayer. That is in obedience to the command of Allah, may He be exalted, in the verse (interpretation of the meaning): “O Children of Adam! Take your adornment (by wearing your clean clothes), while praying” (Qur’an, al-A‘raaf 7:31).
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked about the ruling on praying in nightclothes and attending gatherings wearing them. He said: There is nothing wrong with praying in nightclothes if they are pure, whether one comes to the mosque wearing them or not, unless those clothes will attract attention and criticism, and people will talk about him in their gatherings because of that. People should avoid anything that may be a cause of people backbiting about them.
(Majmoo‘ Fataawa Ibn ‘Uthaymeen, 12/362).
And Allah knows best.
17 Jumada Ula, 1442 AH.