It is said at the graves for men, women, and also for children.
Regarding what is said at the graves, we say that a number of phrases have been reported, and they are similar. Among them is the saying of the Prophet ﷺ: Peace be upon you, abode of a believing people.
You have preceded us, and we, if Allah wills, will follow you.
In some wordings it says: and we will soon join you, and in an addition: may Allah forgive us and you.
We say these supplications, all of them were said by the Prophet ﷺ, so whichever of them you use, there is no harm in it. They are found in the two Sahihs and elsewhere. And Allah knows best.
In some of them: may Allah have mercy on those who come after, with the reported wordings. Alright.