Our sages have said: "Greater are righteous men after their parting than during their lifetime".
Already at the time of our father Avraham, we are witness to the importance of the place of burial.
When Moshe Rabbenu sent spies to spy out Eretz Yisrael, it is written that Kaleb ben Yefune went to Chevron, to the graves of the fathers and therefore he was saved from the counsel of the spies and he even inherited their part.
The Rishonim wrote already about the importance of the graves of tzadikim, even if they didn't define them as holy places.
And Rabbi Chaim Chizkiyahu Medini ("Sdey Chemed") adds that it is forbidden to leave Eretz Yisrael for abroad. Anyway, if he wishes to leave Eretz Yisrael to visit the grave of tzadikim, it is permitted… there is a commandment to visit the graves of tzaddikim so that we should be protected, as it is written regarding Kaleb Ben Yefune etc… It is a great obligation to try and visit graves of tzadikim, which is a great merit. And it is written that visiting the graves of tzadikim in Eretz Yisrael is like fulfilling the commandment of moving to live in Eretz Yisrael.
Rabbi Chaim Vital in his book "Shaar Gilgulim" writes: It is good to go to the graves of tzadikim and pray there. And indeed, prayers at a tzadik's grave which is unknown to the general public and known only to a few people, are more received…"
There are specially appointed times for prayers at tzadikim's graves.
In the book "Shaar Ruach Hakodesh" it is written: "If you pray with holy kavanot at a tzadik's grave, the best time is on the day before the 1st of the Hebrew month or on the 15th, because then the time is more suitable than on other days, like for example: Shabbos, the 1st of the Hebrew month and Festivals, when the tzadik's soul arises to Heaven. On Chol Hamoed you can pray at a grave but not with holy kavanot".
The Ari [Rabbi Itzchak Lurya] said that every day, on the yahrzeit of the tzadik, his soul reaches a higher level. Therefore, it is very good to visit the grave on the yahrzeit day.
"Before going to a tzadik's grave, in particular a public figure or a leader of the Jewish people, the person has to prepare himself in all five matters which are expounded in a discourse on visiting graves of tzadikim written by the Mittler Rebbe of Lubavitch [Admor Rabbi Dovber] and which are appropriate to the Nefesh, Ruach and Neshama, Chaya and Yechida of every Jewish soul (Igeret Kodesh, part 10, page 264).
The request is that the tzadik in his righteousness will recommend the petitioner to the King of Kings, the Holy One Blessed is He (Igeret Kodesh, part 3, page 458).
It is forbidden to sit on a grave (Haramah-Rabbi Moshe Iserlish) and to step on graves, it is not permissible to derive any pleasure from (Kitzur Shulchan Aruch).
In the book Likutei Halachot (Moharan-Rabbi Natan), it is written that it is good to study Torah chidushim which a tzadik wrote at his grave. Therefore, in Israel it is a custom to say a few verses or sayings at the grave of the tanah or prophet who wrote them because it is easier to study them there.
The Maharsha (Rabbi Shmuel Eliezer Idlis) writes that whenever something is said in the name of its sayer, the lips of the sayer move in the grave because the Torah words which he said during his lifetime temporarily enliven him in the grave.
The Ba'al Shem Tov (Rabbi Israel) said that praising a tzadik is like studying the Ma'ase Merkavah.
Death is only relevant to the body since the soul is eternal, especially the soul of a tzadik which doesn't belong in Gehinnom, or in the Purgatory of the grave [Kaf Hakela], etc. Death is not a cessation, but rather the ascent to a higher level. Therefore he is not dead, as it is written in the Zohar (Igrot Kodesh, part 3, page 458).
Our prayer is that the merit of all the righteous will bring the redeemer and the building of our Holy Temple with mercy and compassion.