Photosynthesis is the process in which light energy is converted to chemical energy in the form of sugars. In a process driven by light energy, glucose molecules (or other sugars) are constructed from water and carbon dioxide, and oxygen is released as a byproduct.
In order for gas to leave a planet it needs to be hot enough and to overcome the planets gravity. The outer planets are colder and are very big compared to earth.