Praise be to Allah.
and blessings and peace be upon the Messenger of Allah.
The nails must be cut before forty days have passed, because the Messenger (peace and blessings of Allah be upon him) set that time limit for cutting the nails, shaving the pubic hair, plucking the armpit hair and trimming the moustache. These things should not be left for more than forty days, as was proven from the Prophet (peace and blessings of Allah be upon him) in Saheeh Muslim, 258.
So men and women alike must take care of this matter and not leave the nails, moustache, pubic hair or armpit hair for more than forty days. Wudu is valid and is not invalidated by whatever dirt may be under the fingernails, because it is a small amount and is excused