An endothermic reaction takes in energy from the surroundings. Photosynthesis is endothermic. The energy comes from light, which is absorbed by chlorophyll. It is transferred into chemical energy stored in glucose, so the products store more energy than the reactants.
A cold pack shows the idea. When its chemicals react, they take in energy from their surroundings and the pack gets colder. In photosynthesis the energy taken in is mostly light rather than heat, but the reaction still takes energy in from the surroundings and stores it.
Without light there is no energy for the reaction to take in, so photosynthesis stops. Respiration is the opposite: it releases the energy stored in glucose, so it is an exothermic reaction. Plants respire all the time, but photosynthesise only when there is light.