Glycolysis literally means "glucose breaking." It is the process of breaking down glucose (the opposite of photosynthesis), which occurs in the cytoplasm. This releases some of the energy in the glucose. 2 ATP are used to start the process, but 4 ATP and 2 NADH are produced. What's left is pyruvic acid.
If oxygen is present, the pyruvic acid will be sent for conversion in the mitochondrion, producing 34 ATP molecules.
If there is no oxygen present, fermentation will occur, producing 2 ATP molecules, and lactic acid as a by-product.
The difference between Photosynthesis is simple. By the simple flip of a arrow, in the equation, one process becomes the other. Here is a example.