A friend recently mentioned that she has not gone to her parents grave in over ten years due to its distance and when she wanted to go she was told by a Rabbi that if she has not been there for over seven years she has to send someone first to request forgiveness prior to going. What is the source for this? To which people does this apply? Why seven years?
Nitei Gavriel Hilchos Aveilos 2 - 88:5 mentions that some people have a Minhag if they have not gone for 10 years to their parents grave not to go anymore. Then he goes on to say that there are those who after 7 years of not going to their parents grave do not go anymore. And he concludes that there are those who are not concerned about this at all. Sources mentioned are the Otzar Yad HaChaim 278 in the name of MaHarash M'Belz Zatzal, Mishmeres Shalom 5:32 and Mekor Chaim. It only applies to parents, and only if it was intentional. However if it was impossible to go then the deceased has no complaint and you may go. In 88:11 he mentions that by sending someone first to advise the deceased that the child is coming then even if the child was not there for 7/10 years the child may go.
The She'arim Metzuyanim BaHalachah (128:12) writes that the custom not to visit your father's grave after not seeing him for seven years has no basis in halachah, and we even have a proof to the opposite from the Zohar.
There are many different customs with regards to visiting graves.
The biography prefacing Igros Moshe volume 8 writes that Rabbi Moshe Feinstein didn't visit his father's grave -- "not the custom of Volozhin." Yet years later, when Rabbi Feinstein knew he would soon be leaving Eastern Europe for good, he traveled to his father's grave to say goodbye.