They were not close. They were not trying to develop atomic weapons in a real sense. While they had a broad exploratory program in 1939-1942 (e.g., researching whether atomic bombs could be built), in 1942 they decided to focus their modest program on reactor development, and by 1945 they almost had a prototype nuclear research reactor that would have been able to operate in a self-sustaining way. Almost.
That is not a bomb, or a bomb program. To put it into contrast, by the spring of 1945, the Germans were almost at the same position the United States was at in December 1942. The US bomb program, at that point, required billions of dollars of investment, the labor of literally hundreds of thousands of workers, including thousands of specialized scientists and technicians, and tens of thousands of tons of raw uranium, all to be able to produce a sum total of three atomic bombs by the summer of 1945.
Whether the Germans could have gotten closer than they did if they had not made the decision in 1942 to prioritize reactors is a separate question (I don't think there's any plausible route for them to get an atomic bomb by 1945 no matter what they did, just because of the difficulties that would have existed in their supply chains, resources, and vulnerability to bombing, but that's a counterfactual claim that is hard to "test"), but in terms of how close they were — not close.
The narrative of the "race for the atomic bomb" between the US and Germany is only accurate inasmuch as the American scientists believed they were in a race, to various degrees, at least until 1944. But it is not an accurate reflection of what was actually happening: it is not a "race" if one of the runners doesn't realize they are in a race.
For lots of details on the German project, see esp. the work of Mark Walker. His Nazi Science is a nice popular overview, but for detailed coverage of the German work, what it was and wasn't, see his German national socialism and the quest for nuclear power, 1939-1949.
You may be interested in this document:
From July 3, 1945, to January 3, 1946, the Allies incarcerated ten German nuclear physicists at the English country estate of Farm Hall. Like most POW camps for important German officials, the estate was filled with bugs. This is a transcript of the private conversations the POWs had when they learned of the Hiroshima bombing.
http://germanhistorydocs.ghi-dc.org/pdf/eng/English101.pdf
(The scientists in question are Erich Bagge, Kurt Diebner, Walther Gerlach, Otto Hahn, Paul Harteck, Werner Heisenberg, Horst Korsching, Max von Laue, Carl Friedrich von Weizsäcker, and Karl Wirtz.)
This extract is particulary illuminating:
WEIZSÄCKER: If we had started this business soon enough we could have got somewhere. If they were able to complete it in the summer of 1945, we might have had the luck to complete it in the winter 1944/45.
WIRTZ: The result would have been that we would have obliterated LONDON but would still not have conquered the world, and then they would have dropped them on us.
WEIZSÄCKER: I don't think we ought to make excuses now because we did not succeed, but we must admit that we didn't want to succeed. If we had put the same energy into it as the Americans and had wanted it as they did, it is quite certain that we would not have succeeded as they would have smashed up the factories.
DIEBNER: Of course they were watching us all the time.
WEIZSÄCKER: One can say it might have been a much greater tragedy for the world if Germany had had the uranium bomb. Just imagine, if we had destroyed LONDON with uranium bombs it would not have ended the war, and when the war did end, it is still doubtful whether it would have been a good thing.
It would have been impossible for Nazi germany to develop nuclear weapons, because even if they would have dedicated the same amount of effort that the allies did, they necessary factories would have been bombed before they could complete it.