Yes, visiting graves is a Sunnah for men; the Prophet ﷺ said, "I used to forbid you from visiting graves, but now visit them, for they remind you of the Hereafter." The purpose is to soften the heart, remember death, and make duʿā for the deceased with the lawful wording taught in the Sunnah — not to seek help from the dead, circumambulate the grave, or build structures over it, all of which are forbidden and can lead to shirk. Regarding women visiting graves there is ikhtilāf: many scholars permit it so long as there is no wailing or fitnah, while some restrict it because of the ḥadīth cursing women who visit graves, and the safest for a woman is occasional, calm visiting without lamentation.
Q&A · Rulings
Is it permissible to visit graves?
Evidence — the daleel
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.