Electrons gain energy through the light absorbed by the leaves in the process of photosynthesis. Light posses microscopical particles known as photons, and this particles will excite the electrons present in the photosystem, making them reach a high-energy level state.