Visiting the gravesite expresses respect for the departed, shows that their memory has not been forgotten, and reinforces one's connection to them.
It is considered a great merit to pray at the gravesite of a loved one and that of a great Torah sage, for we are taught that a portion of the soul is always present at the gravesite.
Throughout Jewish history, in times of need, trouble or distress, people would go to a Jewish cemetery and pray to G-d, invoking the merits of the deceased and requesting that they intercede in the Heavens, and carry the prayers to G-d.
One also visits the gravesite to pray for the elevation of the departed soul.
It is also customary to visit on days when prayer is especially appropriate. This includes the Shloshim (thirtieth day from burial), on every Yartzeit (anniversary of passing), and on the days leading into Rosh Hashana and Yom Kippur. Some also visit on the day before Rosh Chodesh (start of the new Hebrew month), and on the fifteenth day of each month.
Days on which it is customary not to visit a gravesite include Shabbat, Jewish holidays, Rosh Chodesh, and the intermediate days of Sukkot and Passover (Chol Ha-moed)
It is customary to limit visits to, and prayers at, a new grave for the first twelve months, except for erecting the tombstone and on the Shloshim (thirtieth day from burial). This is because during this period the soul is undergoing its judgment, and one does not desire to add any additional "burdens" to the tribulations of the soul.
• One who has not been to a Jewish cemetery for thirty days recites a special blessing upon arrival.
• Some people recite Psalms, including Psalm 91, and some add Psalms 33, 16, 17, 72, 104, and 130. Some also recite verses from Psalm 119 that begin with the letters of the Hebrew name of the deceased, and the word נשמה (Heb. soul).
• Some recite additional prayers and supplications.
• Some have the custom to place a pebble or stone on the tombstone, showing that the grave has been visited.