The role of ATP in photosynthesis is to provide energy for the dark reaction {also known as calvin cycle}
More explanation:
Chlorophyll pigment contained in chloroplasts of leaves is the organelle where the light reaction takes place. When sunlight falls on the pigment, due to chemical reaction in it, ATPs are formed. ATP is then used to provide the chemical energy necessary to power other metabolic reactions in cell.
Dark reaction is also called Calvin cycle. It is a light independent process in which the products of the light reaction (i.e., ATPs) are used to form carbon-carbon covalent bonds of carbohydrates. During this process ATP formed during light reaction are utilized. Hence the ATP energy is converted into carbohydrates, which are considered the energy-rich food.