The Germans were not close at all. The head of the Nazi heavy water project, Werner Heisenberg, miscalculated the amount of fissionable material needed to reach critical mass. Heisenberg believed the research and development of an atomic bomb would take a decade to complete, by which time the Nazis believed the war would be over. Because of these mistakes the munitions minister, Albert Speer, did not give the project enough funding to go beyond just basic research. After the Americans dropped the atomic bomb on Japan, Heisenberg assured his fellow researchers, by then imprisoned and recorded by the British, that the Americans were lying and only a very large conventional bomb was used.
When the Americans investigated the German's work on the atomic bomb at the end of the war they were surprised by how little progress had been made.
This answer has tons of material on it.
In short, they were far. By 1945, they were still 3 years behind the production phase of the United States and moving at a much slower pace. Even if they had tried to build it around then, they probably would've ended up getting the attempt bombed.
So really, it was unlikely they were gonna get it.
One point of clarification that is sometimes missed: the German nuclear program was primarily focused on the problem of building small nuclear reactors. The goal was to make a reactor that could be used for military propulsion, e.g. in a ship. It was not geared towards building plutonium production reactors which are much larger and have different efficiency profiles.
They also pursued isotope separation, but this was related to the reactor issue. For compact reactors you generally need somewhat enriched fuel.
When Heisenberg et al. were "racing" at the end of the war to complete their reactor, it wasn't because completing it would change the course of the war. It is because the scientists wanted a concrete achievement to come out of the work, with the idea that they might be able to sell their services to the Allies in the postwar. As it turned out, they were so far behind the American work that the US had no use for them. But they didn't know that.
Sometimes the above facts get confused and people think that if Heisenberg had gotten his reactor working that it would have led to some kind of quick turn-around on a bomb. This is just technically not the case. The amount of plutonium extractable from a small reactor is not enough to matter on that time-scale.