Photosynthesis, which takes place in chloroplasts of plant cells is the process by which light-energy is converted to chemical energy in the form of ATP and glucose. Photosynthesis is split into two stages; the light-dependent reaction where the light energy absorbed by photosynthetic pigments is used to form ATP and reduced NADP. During this process, water is oxidised to oxygen. In the second process, the light-independent reaction, reduced NADPH and ATP from the light-dependent reaction supply the energy and hydrogen to make glucose from carbon dioxide.
To add to mmnfiore's points, but only in a slight sense, the two stages of photosynthesis can be categorised as follows:
In the light dependent reaction: Light hits chlorophyll (in the thylakoid membrane), and electrons get excited. These excited electrons are passed down electron carriers of diminishing energy thresholds, releasing energy at every turn. This energy allows for the bonding of NADP and protons (the origins of these will be explained shortly) The NADP binds with the H+ ions, forming NADPH, or reduced NADP. The emitted electrons also allow for the bonding of ADP and inorganic phosphate to create ATP.At the same time, light hits water (photolysis) and splits water molecules into protons, (H+,) electrons, and Oxygen. The Oxygen is evolved out of the leaf. The ATP and NADPH are used in the light independent reaction, which can be summarised as follows:2 molecules of RuBP (Ribulose bisphosphate) form an unstable hexose compound, through the fixing of CO2 in the presence of the enzyme Rubisco. This unstable hexose compound almost immediately breaks to form 2 molecules of GP (glycerate-3-phosphate.) These 2 molecules of GP form 2 molecules of Triose Phosphate, TP using the ATP and NADPH from the Light-independent reaction. These 2 molecules of TP can be used to create organic compounds, such glucose, or be recycled to form more RuBP, using molecules of ATP.
In addition to the excellent answer above, the formula showing the production of glucose and oxygen from water, warmth and Carbon Dioxide can be presented as follows (simplified version):6CO2 + 6H2O + light C6H12O6 + 6O2 (6 molecules of Carbon dioxide plus 6 molecules of water + light One molecule of glucose plus 6 molecules of oxygen.
BTW, indicates that this is a reversible process: the glucose and oxygen can be recombined/broken down to Carbon dioxide and water and light or heat energy again --> combustion.