Several languages are involved here. The first part of the word is Urdu and means "leg" but this word also comes more remotely from the Persian language, ancestor of modern Farsi. The second part comes from the Hindi word meaning clothing. However, especially since the languages are closely related, you will often see that the whole word is either Urdu, Hindi, or Persian in origin. a pair of loose trousers tied by a drawstring around the waist; worn by men and women in some Asian countries
Pyjama \Py*ja"ma\, n. [Hind. p[=a]e-j[=a]ma, literally, leg clothing.
In India and Persia, thin loose trowsers or drawers; in Europe and America, drawers worn at night, or a kind of nightdress with legs.
Source: The Collaborative International Dictionary of English v.0.48