You might be interested in some previous threads on the German nuclear program:
General Program
-o- In "Did Heisenberg manage to develop the theory behind a Nuclear Bomb before the way ended", /u/restricteddata gives an overview (2 comments | less than 1 month old)
-o- "Why was the Nazi nuclear program so much less successful than that of the allies? Is there anything they could have done differently to greatly increase their chances of producing a bomb?" (19 comments | over 1 year old)
-o- "How close were the Nazis to developing a nuclear bomb?" (9 comments | over 1 year old)
-o- "Was the failure of the Nazi's nuclear program decided by a 2-1 vote?" (14 comments | over 5 months old)
-o- "Is there any truth to the story of Heisenberg intentionally sabotaging the Nazi nuclear program in WWII?" (4 comments | over 11 months old)
-Followup Questions
If, after looking through the above threads, there are major questions that have been left unanswered or specific topics given insufficient detail, feel free to ask followup questions. Liberal quoting from these threads are encouraged to both allow for clearer answers and to prevent users from wasting time repeating points already addressed.
/u/restricteddata is flaired on the topic and has answered a plethora of questions on it in the past, and would likely be able to answer followup questions.
In essence, the answer is: not close. They weren't building an atomic bomb. They had a nuclear reactor program. They got somewhat close to building a successful (small scale) reactor. They got nowhere near to building an atomic bomb.
The responses previous threads (many of which I wrote) outline some of the key reasons for this, and the decisions that led to this, and so on. But essentially the idea that the US was neck-and-neck with the Germans in a "race for the bomb" is a complete myth, perpetuated today in part to justify the US bomb program. The US thought it was in a race for awhile, but in fact it was racing only against itself (and maybe the end of the war in general).
On the whole, not at all.
Oh, it could have done it, and maybe even in about the same time as it was done in the United States. But in order to have the resources to do that it would have to cancel, well, basically WWII.
In some magic universe where they win and no one else develops nukes, I'd peg the earliest time they could do it sometime in the 50s. Maybe. If their economy hasn't collapsed yet from a lack of new countries to loot, anyway.
John Wheeler, who worked on the Manhattan Project, talked about German efforts in his memoir.
As a result of experiments such as those carried out by White and Creutz, those of us thinking about reactor design concluded that carbon in the form of graphite would be a suitable moderator, if it could be secured in pure enough form. We knew that "heavy water" ... would be even better, but it would be costlier to make. ...
Fortunately for us, our German counterparts reached a different conclusion. They thought that neutron absorption in graphite made it an unsuitable moderator, and they therefore turned their attention to acquiring large quantities of heavy water.
...
The German misjudgment about graphite was one of the things that slowed their progress toward a bomb. At the end of the war in Europe, two and a half years after Fermi's pile went critical, the Germans did not yet have an operating reactor, much less any clear idea of how to build a bomb.
[Wheeler also describes how Allied commandos successfully destroyed a heavy-water plant at Vemork, Norway in March 1943]
Wheeler then goes on to talk about Heisenberg:
After Heisenberg abruptly left the University of Michigan summer school in 1939 for "machine-gun practice in the Bavarian Alps," a dozen years passed before I saw him again. ... I remain as uncertain as anyone about his motivations during the war, when, according to some observers, he may have deliberately stalled the German atomic-bomb effort. The more credible view now is that he and his German colleagues did not press for massive resources to go forward with a bomb project because they imagined the time scale for the project to be greater than the time scale of the war, and had no inkling that the Allies were building a bomb.