All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
In principle, there is no difference between a man's grave and a woman's grave. Therefore, there is no evidence in the Sharee'ah that differentiates between a male's tomb and that of a female.
The Prophet said: “Dig the grave deep, make it spacious and prepare it well.” [Ibn Maajah]
But if the question is about burying a male and female in one grave, we state that there is no difference of opinion among the Muslim scholars – according to our knowledge – that only one dead person should be in each grave unless there is some necessity, such as difficulty in digging or lack of space.
According to At-Tirmithi's narration, the Prophet ordered that two or three of the martyrs of the battle of Uhud be buried in one grave, since there was not enough space. And he ordered to advance those who memorized more of the Quran. Ibn Qudaamah said in his book Al-Mughni: “If the above narration is proved, there should be a barrier of soil between them since the shroud is not enough.” If there is some dire need to bury a male and female in one grave, then there should be a barrier of soil between them. This does not mean to bury one above the other, since the grave is special for its inhabitants, and no one should sit or step on it. Ibn Qudaamah added: “It is better to make a cleft between the two persons buried in one grave and put one's head near to other's legs (or shoulders).”
Allah knows best.