Sorry there chimichurri I missed that second part! Moskva Is right!
In Photosynthesis: water is split using sunlight; and this releases electrons. These electrons are used to load NADP+ into NADPH. Also, hydrogen ions (H+) are released. These build up on one side of the membrane, creating a 'proton gradient'. (Since there is a lot of them on one side, they want to diffuse to the otherside). They then pass through this protein called ATP Synthase, which acts like a watermill; adding the third phosphate group to ADP; forming ATP!
This ATP is then used up in the light independent stage - which produces glucose.
So while photosynthesis does produce ATP; it's only in the first light dependent stage. There is none left over at the end!
This may sound similar to the Electron Transport Chain! In fact: it is! Except the direction of H+ ion flow is the opposite, and other reactions happen (Such as FADH, etc...) and the H+ ions come from the NADH/FADH produced in the krebs cycle etc... (instead of water).
Moving back a bit, during glycolysis (when glucose is split); it produces two 'pyruvate' molecules;
The thing is, it also takes two ATP to do this. So it is really a net 2 ATP produced (as it takes 2, but makes 4). Note that the atoms in glucose aren't being made into ATP; it's just the electrons!
Hence in photosynthesis: Sunlight & Water --> e- --> ATP....... --> Glucose
And in Cellular Respiration: Glucose --> e- --> ATP
So it's the electrons from ATP that are transferred. Not the ATP molecules!
I don't think you need to know all that btw... 😆