Praise be to Allah.
Cats are pure (taahir) and not impure (najis), because of the report narrated by Abu Dawood (75), at-Tirmidhi (92), an-Nasaa’i (68) and Ibn Maajah (367) from Kabshah bint Ka‘b ibn Maalik, that Abu Qataadah came in when she had prepared water for Abu Qataadah to do wudoo’. A cat came and drank from the water, and he tilted the vessel for it so that it could drink. Kabshah said: He saw me looking at him and said: Do you find it strange, O daughter of my brother? The Messenger of Allaah (blessings and peace of Allah be upon him) said: “They (cats) are not impure, they are of those who go around amongst you.”
Classed as saheeh by al-Albaani in Saheeh Abi Dawood and elsewhere.
At-Tirmidhi said, commenting on it:
This is a saheeh hasan hadeeth, and this is the opinion of most of the scholars of the Companions of the Prophet (blessings and peace of Allah be upon him), and of the Taabi‘een and those who came after them, such as ash-Shaafa‘i, Ahmad and Ishaaq. They did not see anything wrong with water that a cat has drunk from.
As-San‘aani (may Allah have mercy on him) said: In this explanation there is an indication that Allah has made them like servants in that they are very close to the people of the household and spend a lot of time with them. Therefore Allah has made things easy for His slaves by ordaining that cats are not impure, so as to avoid hardship. The hadeeth indicates that cats and water that they have drunk from are pure (taahir)
End quote from Subul as-Salaam, 1/24
If water from which a cat has drunk is pure, then it is more apt that its hair should be pure too. Ibn Qudaamah (may Allah have mercy on him) said:
In the case of all animals, the ruling on their skin, hair, sweat, tears and saliva is the same as the ruling on water from which it has drunk, with regard to whether it is pure or impure.
End quote from al-Mughni, 1/46
In fact the correct view is that the hair of all animals, whether they may be eaten or not, is pure (taahir), as was stated by Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him).
All hair, feathers and wool are pure (taahir), whether they are from the hide of an animal whose flesh may be eaten or an animal whose flesh may not be eaten, and whether the animal is alive or dead. This is the scholarly view that is most correct.
End quote from Majmoo‘ al-Fataawa, 21/38
He also said:
The way hair lives is comparable to the way plants live, and not the way animals live; it develops, it is nourishes and grows like plants that have no senses and cannot move by free will. It does not die when the animal dies, therefore it does not become impure (najis) when the animal dies.
End quote. Majmoo‘ al-Fataawa, 21/98
It is well known that cats move a great deal, coming and going, so there can be no doubt that some of their hair is shed, because of their moving about in the house and rubbing against the furniture and so on. We know nothing about the Prophet (blessings and peace of Allah be upon him) taking precautions to avoid it or instructing others to do so, in addition to the fact that he said, “They are not impure.” Thus it is known from the above that cat hairs are pure (taahir) and that it does not matter if some of their hairs get onto your clothes, whether that happens when you are praying or otherwise.
With regard to the teacher saying that if anyone prays with more than three cat hairs on their clothes, their prayer will not be accepted, this is an unacceptable statement, because there is no evidence for it. Rather the evidence is to the contrary, as stated above.
But we should draw your attention to the fact that keeping cats in the house may lead to transmission of some diseases, according to what Allah wills, so it is essential to take precautions in that regard and pay attention to the necessary measures.
And Allah knows best.
For more information please see the answer to question no. 22373