Okay, so you run your code,
defGrSty = Directive[{Thickness[0.0002], Black, Opacity[1.0]}];
defEp = {defGrSty, InfiniteLine[{{0, 5}, {2, 5}}]};
data = {{1, -12}, {2, 3}, {3, 10}, {4, 20}, {5, 42}};
plot = ListPlot[data, PlotRange -> Full, GridLinesStyle -> defGrSty,
GridLines -> Automatic, Epilog -> defEp]
and it does not display the gridlines and the added line in the same style,

You have a couple options. If you want to use the output elsewhere, just export it to PDF, and it displays just fine
Export["temp/plot.pdf", plot]

Or, if you want it to display in the notebook properly, you can go through this rigmarole
grdlns = AbsoluteOptions[plot, GridLines][[1, 2, All, All, 1]];
AppendTo[grdlns[[2]], 5.];
ListPlot[data, PlotRange -> Full, GridLines -> glns,
GridLinesStyle -> defGrSty]

At the heart of the matter, it seems to do some kind of rounding for the values of Thickness
that are given to GridLinesStyle
. Here, for each pair the one on the left is a Line
and the one on the right is a GridLine
, both with the same style,
opts = {ImageSize -> {50, 100}, AspectRatio -> 2,
PlotRange -> {{-1, 1}, {-2, 2}}, Axes -> False};
img = Grid[{GraphicsRow /@ ((defGrSty =
Directive[{Thickness[#], Black, Opacity[1.0]}];
{Graphics[{Directive[defGrSty], Line[{{0, -2}, {0, 2}}]},
opts],
Plot[Null, {x, -2, 2}, GridLines -> {{0}, None},
GridLinesStyle -> defGrSty, Evaluate@opts]}) & /@ {0.001,
0.002, 0.01, 0.02, .03, 0.04})}]

But again, it goes away if you export to pdf, as LLlAMnYP pointed out.
defGrSty = Directive[{Thickness[0.0002], Black, Opacity[1.0], Magnification -> 1}]; defEp = {defGrSty, Magnification -> 1, InfiniteLine[{{0, 5}, {2, 5}}]}; data = {{1, -12}, {2, 3}, {3, 10}, {4, 20}, {5, 42}}; Show[ListPlot[data, PlotRange -> Full, GridLinesStyle -> defGrSty, GridLines -> Automatic, Epilog -> defEp], Magnification -> 1]
I am using Mathematica 10.1 . $\endgroup$Thickness
, the gridlines and the line have the same apparent style and for others they do not. $\endgroup$