It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you performs ablution and puts on his leather socks, let him pray in them and wipe over them; then, if he wishes, he need not take them off, but if he is in a state of major ritual impurity (janabah), let him take them off."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 1329