* In the grand scheme of life on Earth: Photosynthesis came first. Early life forms were likely anaerobic (didn't use oxygen), and photosynthesis evolved, producing oxygen as a byproduct. This eventually led to the oxygen-rich atmosphere we have today, which enabled the evolution of aerobic organisms that use cellular respiration.
* In a single organism: Cellular respiration can happen in the absence of photosynthesis. For example, animals can't photosynthesize, but they still need cellular respiration to obtain energy.
* Within a plant cell: Photosynthesis happens first, producing the glucose that is then used as fuel in cellular respiration.
So, the answer depends on the context.
Here's a simple way to remember it:
* Photosynthesis makes the food (glucose).
* Cellular respiration breaks down that food for energy.