Photosynthesis evolved by 3 billion years ago and released oxygen into the atmosphere. Cellular respiration evolved after that to make use of the oxygen.
How long ago did cellular respiration evolve?
The origin of oxygenic photosynthesis in Cyanobacteria led to the rise of oxygen on Earth ~2.3 billion years ago, profoundly altering the course of evolution by facilitating the development of aerobic respiration and complex multicellular life.
How did respiration evolve?
Respiration, a process which uses an oxidant to transfer the energy of metabolites to the phosphate pool, assumed various forms during evolution, from those using low-potential oxidants, like sulfur, to more powerful ones like NO or nitric acid and of course oxygen.