The correct diagram is C.
In fact, the magnetic force works as the electrostatic force: like poles repel each other, while opposite poles attract each other. In this example, we have two magnets one next to each other, and we see that the north pole of one magnet is close to the south pole of the other: therefore, the two poles attract each other, so the two magnets will move closer, as in diagram C.