Visiting the gravesite of Tzaddikim on Erev Rosh Hashanah:
It is customary of some communities to visit the gravesite [of a Tzaddik] on Erev Rosh Hashanah [after Shacharis] and increase in supplication while there. [The Chabad custom is to visit the gravesite of the Rabbeim on Erev Rosh Hashanah. Those that live nearby go to the Ohel of the [Rebbe] and Rebbe Rayatz in Queens. One is not required to visit a gravesite if it is an area of danger.]
 Rama 581/4
Source in Gemara for visiting graves of Tzaddikim: The Gemara in Taanis 16a states that on certain fast days one is to visit a gravesite. One of the reasons mentioned is in order so they pray on our behalf. Likewise in the Gemara in Sota 34b it states that Kalev Davened by the gravesite of our forefathers in Chevron.
 M”A 581/16 “That one is to be Mishtateiach on Kivrei Tzaddikim”; Kitzur SHU”A 128/13
 Kitzur SHU”A 128/13
The Chabad custom? In Lubavitch the custom was to visit the gravesite immediately after Selichos, prior to Davening Shacharis. [Reshimos Devarim 326; Otzer Minhagei Chabad 43] However the Rabbeim, would visit the gravesite only after midday. [ibid]
 The reason: The burial area of a Tzaddik is holy and pure and due to this one’s prayers are accepted above. [Drashos Mahril; Elya Raba 581/39; M”B 581/27; Kaf Hachaim 581/94] The Sefer Chassidim 450 elaborates on the greatness of visiting the grave of one’s forefathers.
Visiting the gravesite of Reshaim: One is not to visit the grave of a Rasha as doing so causes Mazikim [damaging spirits] to attach to him. [Kaf Hachaim 581/90]
 This was the vintage custom practiced in Lubavitch, to visit the gravesite of the Rebbeim on Erev Rosh Hashanah. [Koveitz Lubavitch 5/70] The Rebbe Rashab would travel to the Ohel of his father, the Rebbe Maharash, and the Tzemach Tzedek. The Rebbe Rayatz would visit the Ohel of his father, the Rebbe Rashab, in Rostov. [Otzer Minhagei Chabad 44]
 Sefer Haminhagim p. 117 [English] The Rebbe would visit the Ohel of his father in-law the Rebbe Rayatz on Erev Rosh Hashanah after midday. The Rebbe would stay there for many hours until the time of Mincha. While there the Rebbe would read thousands of names that he received from people all over the world to arouse mercy on their behalf. [Otzer Minhagei Chabad 47-48]
 Drashos Mahril; Elya Raba 581/39; Kaf Hachaim 581/94