The discovery of nuclear fission and its possibility for use as a weapon was widely-reported in both scientific and journalistic spheres in the period of 1939-1941. It was in the category of "theoretically possible but probably hard to pull off." Which was all true.
Here's what pretty much anyone who read physics journals would know by 1940:
The isotope uranium-235 was in principle fissile — it could be split with low-energy neutrons and would release neutrons that could continue a chain reaction
In principle you could probably isolate the isotope uranium-235 from uranium-238, but it would be very hard to do. Which methods might or might not work would not be popularly known.
If you had enough U-235 in one place, it could probably explode. How much you would need was not well-known.
If you had uranium in the right arrangement, you might be able to make a controlled nuclear reaction (a nuclear reactor), but that might still prove difficult to make work in practice. The specifics of the "right arrangement" were not known.
One might compare it to some of the current discussions about space travel. [Project Orion](https://en.wikipedia.org/wiki/Project_Orion_(nuclear_propulsion)) — theoretically possible, hard to pull off. The space-cities of Gerard O’Neill — nothing prohibits their development except the practical difficulties.
What was not known:
Exactly which methods of enriching uranium would actually be practical.
That nuclear reactors can produce other synthetic elements, including element 94, which could be used in a bomb.
The specifics of how long it might take to make a nuclear weapon, how hard it would be, or how such a weapon would work or look other than the splitting of atoms. Even very basic questions like "could it fit into a backpack or would it require a barge?" were not clear until one actually did quite a bit of work (on things like the critical mass, the assembly mechanism, etc. — in reality, both of the atomic bombs were about the size of a car, which is pretty big for a gravity bomb in WWII but not too big to avoid being dropped out of a plane).
The atomic bombs did not require any new theory that had not been developed by 1940 or so. This is one of the reasons that the US thought they were in such a "race" with the Germans — there was no really "secret" physics involved, just what you would learn from actually trying to build these things.
So while the atomic bombs were a genuine shock, it was not because nobody thought they couldn't exist, but because nobody expected them to be developed so relatively quickly. They were "on the radar," so to speak, of educated peoples, and to some degree the idea that radioactivity could be a source of massive amounts of energy (and weapons) had been on the cultural "radar" since the 1920s. But the idea that someone would actually be able to weaponize nuclear fission was a big surprise in 1945, because everyone outside of the weapons complexes (and even some of those within them) expected this to be a problem of a future generation, not the present one. The period between theory and reality was remarkably short in this instance.
To elaborate on /u/restricteddata's response :
This article is relevant. As it points out, the idea that radioactivity and the secrets of the atom could lead to energy found its way to non fiction articles and to speculative fiction quite early.
The splitting of Uranium 235 led to a number of articles and editorials on the use of atomic energy in 1940, before wartime censorship was imposed. This 1940 Collier's article was similar to others in the NY Times, Harpers etc in focusing primarily on the peaceful uses of the energy, but the basic principles and the possibility of weaponizing it would have been a logical extension. The War Department even tried unsuccessfully to prevent distribution of the September 7 1940 issue of the Saturday Evening Post; though this was not revealed till 1945
In any event, public focus on the possibilities was low and overshadowed during the war years
However, stories published in Astounding Science Fiction by Heinlein and the historically significant "Deadline" by Cleve Cartmill point to how a well read and educated outsider using unclassified information could view the issue. (Admittedly both were spurred by editor John Campbell). Heinlein wrote of radioactive dust being used as a weapon against cities, as being a threat to world peace and resulting in an arms race and standoff. Deadline was even more remarkable as it described the isotope separation, the availability of pounds of U235, the theoretical use of boron, and the bomb, as well as effects of an explosion, and a debate on using it; this spurred the FBI to investigate the author and others for leaks related to the Manhattan project, more than a year before Hiroshima. Robert Silverberg's articles on this topic are as readable as others. ; Cartmill's design would not have worked. (links : Murray Leinster and Edward Teller via Benford]
Alex Wellerstein's point on the then state of informed amateur view of atomic energy are worth quoting
"It is a mixture of accuracy and confusion, of guess and folly".
"Atomic energy was a topic, it was an idea — but it wasn’t yet something tangible, a reality."
He cites Campbell’s 1941 article "Death Dust".
[Aspects that are dead on]: that U-235 is the important isotope, that isotope separation is going to matter, that places with particle accelerators are going to play a role, that the acquisition of uranium ore was about to get important, that fears of German use of atomic energy existed.
But specifics of the bomb, radioactive dust, reactor etc are often wrong or confused. And none mention Plutonium/element 94
The idea of the atomic bomb was introduced to science fiction as early as 1914 in H.G. Wells' "The World Set Free" - the book may have even influenced the bombs development. At least some members of the public might have been familiar with the concept even if they weren't too scientifically inclined.