Praise be to Allah.
The nails must be cut within forty days (of the last cutting), because the Messenger of Allaah (peace and blessings of Allaah be upon him) specified a time limit within which people should cut their nails, shave their pubic hair, pluck their armpit hair and trim their moustaches, and not leave it for more than forty days. This was proven from the Messenger of Allaah (peace and blessings of Allaah be upon him). Anas (may Allaah be pleased with him), who was the servant of the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “He set a time for us to trim our moustaches, cut our nails, pluck our armpit hair and shave our pubic hair; we were not to leave that for more than forty days.” Narrated by Imaam Muslim in al-Saheeh (258). It was also narrated by Imaam Ahmad (11823) and by al-Nasaa’i (14) and a group with the wording: “The Messenger of Allaah (peace and blessings of Allaah be upon him) set a time limit for us, we were not to neglect our nails and moustaches, and shaving the pubic hair and plucking the armpit hair beyond forty days.” Both men and women must pay attention to this matter and not leave the nails, moustache, pubic hair or armpit hair for more than forty days. Wudoo’ is valid and is not affected by whatever dirt is under the fingernails, because it is a small amount and may be forgiven.