Auspicious times of visiting a cemetery during the year:
It is an auspicious time to visit the gravesite of Tzaddikim on Erev Rosh Hashana, Erev Rosh Chodesh and on the 15th of the month. These are the main times that one is to visit the tomb of Tzaddikim.
Times that one is not to visit a cemetery:
One is to avoid visiting a cemetery on Rosh Chodesh, Shabbos and Yom Tov. However practically today the custom has become to visit graves on Rosh Chodesh. However one is not to recite the Maaneh Lashon or other lamentations, although he may ask requests or recite Tehillim. One may certainly visit the grave of Tzaddik on Rosh Chodesh to pray for an ill person.
May one visit a cemetery at night?
Some avoid visiting a cemetery at night. However the widespread custom is to visit Kevarim even at night.
Visiting a Kever twice in one day:
One is not allowed to visit the same gravesite twice in one day.
 Kaf Hachaim 581/98; Alef Lamagen 581/110
 See Gesher Hachaim chapter 29; Nitei Gavriel 83/1-4
 Kol Bo brought in Beir Hagoleh Yoreh Deah 344/20 [regarding Rosh Chodesh even if falls on seventh of Shiva] Alef Lamagen 581/110; Mishmeres Shalom 5/129
 Shaar Hayichudim of Arizal p. 5 [the souls are not by the graves]; Alef Lamagen 581/110; Mishmeres Shalom 5/129;
The reason: As on these days the souls of the Tzaddik are not found in their graves. [Arizal in Shaar Hayichudim p. 5]
 Gesher Chaim Vol. 1 ch. 29 [p. 259]; Nitei Gavriel 83/3 footnote 3; Daas Torah 581 [brought in Nitei gavriel ibid]
The reason: As the avoidance is only to prostrate oneself on the grave and recite the accustomed lamentations [Maaneh Lashon]. However to pray by the grave was never intended to be forbidden even by the above Poskim. [Gesher Hachaim]
 Mishmeres Shalom 5/29
 Nitei Gavriel Aveilus 2/82-10
 Divrei Torah 3/44
The reason: Perhaps this is due to that the side of Gevura and evil is stronger at night and hence we avoid entering the area. Alternatively the reason is because one does not recite Tehillim at night until midnight. [Nitei Gavriel ibid]
 M”A 581/16; Kitzur Shlah Rosh Hashana in name of Mahraiy; Tzavaas Rav Yehuda Hachassid 12; Reb Chaim Vital in Taamei Hamitzvos Vayechi; Alef Lamagen 581/109; M”B 581/27; Kaf Hachaim 581/96