Where does the oxygen in earth's atmosphere come from?

The origin of oxygen (and other large elements) is from supernovae.

On the smaller scale, the vast majority of our oxygen comes from ocean plants, from tiny algae to giant kelp. The atmospheric oxygen comes from the decomposition of water and carbon dioxide by organisms that use photosynthesis to make useful molecules in combination with the energy from sun light.