****Vertical profiles of the mixing ratios of selected species at the equinox**** R. M. Goody and Y.L. Yung, Atmospheric Radiation, Theoretical Basis, OUP, 1989.
This wikipedia article has a great discussion of the topic: https://en.wikipedia.org/wiki/Geological_history_of_oxygen
Before photosynthesis evolved, Earth's atmosphere had no free $\ce{O2}$. Photosynthetic prokaryotic organisms that produced $\ce{O2}$ as a waste product lived long before the first build-up of free oxygen in the atmosphere, perhaps as early as 3.5 billion years ago. The oxygen they produced would have been rapidly removed from the atmosphere by weathering of reducing minerals, most notably iron. This 'mass rusting' led to the deposition of iron oxide on the ocean floor, forming banded iron formations. Oxygen only began to persist in the atmosphere in small quantities about 50 million years before the start of the Great Oxygenation Event. This mass oxygenation of the atmosphere resulted in rapid buildup of free oxygen. At current rates of primary production, today's concentration of oxygen could be produced by photosynthetic organisms in 2,000 years.
Since the start of the Cambrian period, atmospheric oxygen concentrations have fluctuated between 15% and 35% of atmospheric volume. The maximum of 35% was reached towards the end of the Carboniferous period (about 300 million years ago), a peak which may have contributed to the large size of insects and amphibians at that time. Whilst human activities, such as the burning of fossil fuels, have an impact on relative carbon dioxide concentrations, their impact on the much larger concentration of oxygen is less significant.