What's the difference in subatomic structure between a conductor and a non-conductor? I mean, some elements don't conduct electricity, while some do.
They are all atoms, and electricity is always electrons.
So why won't it flow sometimes, and why does it flow in other times?
 A: Conduction of charge has to do with the availability of electrons in the element to conduct charge by physically moving from one place inside the crystal structure of the material to another (that's what current is, movement of charge). Group I-III and transition elements conduct electricity. Moreover, they are solids so there is a high density of atoms per unit area inside them and thus a high density of electrons. Now in these elements, there are usually only 1 to 3 electrons available for conduction. What you have to realize is that, normally, with less than 4 electrons in the valence shell the nucleus is generally not strong enough to be able to confine the outermost shell electrons to the atoms. So these electrons usually fall out of the atoms, making them ions, and move about in the solid, always being affected by the charge of other nuclei nevertheless. This is called being in the conduction band, where the electron can move and conduct. That is why metals are described as ions in a 'sea of electrons'. And this type of bonding is called metallic bonding, which is described by the presence of ions and free electrons. Now this cannot happen if the nucleus is stronger than in the above situation, or there are more than 3 electrons in the valence shell. Now losing one electron requires a lot of energy as the nucleus is pulling with a greater charge (electrons in the valence shell are roughly the same distance off from the nucleus). This means no more formation of ions. Thus in carbon, for example, covalent bonds exist. And there are no free electrons in the material when the bonding is covalent, as the electrons are shared by atoms and aren't let go to roam about. Therefore, carbon, or diamond is a very good insulator. Similarly in oxygen or some other gas, for example, the bonding is covalent, so the electrons are not available for conduction. Furthermore, in gases the density of electrons is already less, but they still can conduct if ionised, meaning that they can lose/gain an electron, forming charges that can move and conduct (lightening strike).
So it's not as simple as just atoms lying around in any material in similar fashions. No, there is a huge difference between how the atoms end up arranging themselves/forming some kind of bonds according to what is energetically the most feasible. And the type of bonding is the key here, it gives rise to the presence or absence of 'free' electrons in the material for conduction.
Also, there are ionic solids, for example, which are compounds containing positive and negative ions held in fixed positions, this time due to the highly attractive forces. So there is nothing to move about and conduct electricity. But if you melt, for example NaCl, then you're giving the ions energy to overcome those highly attractive forces and move about. That's why ionic liquids conduct electricity and ionic solids do not.
So basically in the end, in a conductor, there appear free electrons but for an insulator that is not the case.
A: Conductivity depends on whether or not the electrons are free to move. In metals and semiconductors, the valence electrons are not attached to the atoms and can therefore conduct electricity. In insulators, the valence electrons are tightly bound to the atoms and an external electric field does not affect them but just causes polarization. 
