The chloroplasts within a cell are responsible for harnessing (capturing) sunlight energy and using that energy during photosynthesis in order to make energy for the plant (in the form of a sugar called glucose).
The green pigment called chlorophyll resides in the thylakoids of the chloroplast. The chlorophyll is what captures the sunlight energy. This energy is then used during photosynthesis. Photosynthesis converts carbon dioxide (which enters the plant via the stomata of the leaves) and water (which is absorbed by the plant's roots) into oxygen gas and a sugar called glucose. The plant can use glucose as a readily available source of energy, or store it as starch for a later use.