How and when did the ozone layer form?
The conventional answer is "it formed by the Chapman mechanism", which implies that the layer was created when the atmospheric concentration of oxygen was sufficient.
A theory for the origin of this ozone layer was proposed in 1930 by a British scientist, Sydney Chapman, and is known as the Chapman mechanism. The basis is that ultraviolet light breaks the bond between two oxygen atoms in molecular oxygen at high altitude. The highly-reactive single oxygen atoms attack molecular oxygen which is in contact with a third non-reacting agent. However, ozone is unstable and will revert to oxygen by a reverse process. Thus the ozone layer is the result of an equilibrium between the splitting, the formation of the ozone, and its decay back to oxygen.
This implies that the ozone layer gradually built up in step with the increase in concentration oxygen in the atmosphere once plants appeared and photosynthesis got under way.
The Chapman hypothesis was re-examined in the 1980s as a result of political pressure to reduce the production of CFCs. Some people argue that it is flawed in a way that Chapman could not have known in 1930 as quantum mechanical calculations had not been sufficiently developed. The flaw is that the energy in an ultra-violet quantum is insufficient to break the bond, at least in the mechanism as accepted. This issue has become important because some people believe that CFCs interfere with the Chapman Mechanism and might cause a reduction in ozone concentration. The current position is unclear.