The Ben Ish Hai (Rabbi Yosef Haim of Baghdad, 1833-1909), in Parashat Kedoshim (24), writes that before one washes Netilat Yadayim for bread, he must remove the dirt stuck underneath the part of the fingernail that extends beyond the skin of his finger. If there is dirt underneath that part of the fingernail at the time of Netilat Yadayim, that dirt must be removed before one performs Netilat Yadayim.
This applies, however, only on weekdays. On Shabbat, scraping dirt off one’s fingernail is forbidden (as it smooths the nail, in violation of the prohibition of Memahek).
The Ben Ish Hai notes that dough constitutes a Hasisa anywhere underneath the nail, even on the part that is flush with the skin. Women must therefore be reminded to thoroughly wash their hands after baking to ensure that all particles of dough are removed before they wash Netilat Yadayim.
The Ben Ish Hai adds in this context that it is improper to let one’s fingernails grow long. For one thing, he writes, there is a greater chance of accumulating dirt underneath fingernails if they grow long, which, as we have seen, could invalidate one’s Netilat Yadayim. More generally, however, the Ben Ish Hai writes that long fingernails are spiritually detrimental, as they invite the forces of impurity onto a person’s hands. Therefore, for both Halachic and mystical reasons, fingernails should not be allowed to grow long.
Summary: Before one washes Netilat Yadayim on weekdays, he must remove any dirt found underneath the part of the fingernail that extends above the skin of the finger. On Shabbat, removing this dirt is forbidden. If a person has dough particles underneath any part of the fingernail, they must be removed before Netilat Yadayim. It is not appropriate to allow one’s fingernails to grow long.