GraphicsGrid of plots with legends

It's a bug. I had a similar problem with GraphicsGrid, reported it, and received a reply from WRI tech support. I quote the relevant portion.

When you put the plots inside a GraphicsGrid, they are put inside individual insets. Unfortunately, there is a known issue with GraphicsGrid failing to determine the optimal size for graphics with insets.

So, I recommend you to avoid using plots along the GraphicsGrid.

Try Grid instead.

Grid @
  Table[
    ContourPlot[Cos[x]/k + Cos[m y], {x, 0, 4 Pi}, {y, 0, 4 Pi}, 
      ColorFunction -> "Rainbow", PlotLegends -> Automatic],
    {k, 1, 2}, {m, 1, 2}]

grid