Cells get energy in the form of food molecules if they are animal cells or sunlight if they are plant cells. The process used by all cells to create usable energy is quite similar, no matter the source of the energy.
Animal cells have semi-permeable outer membranes that allow some molecules, such as the sugars and fats that are necessary for the creation of energy, to enter the cell. Once these molecules are inside the cell, the bonds that hold them together are gradually broken down. Each time a bond is broken, it releases energy that the cell can either burn immediately or store for later use. Energy that is stored is reassembled in the form of ATP molecules. These molecules have bonds that are easy to break quickly whenever the cell needs energy.
Plants get the nutrients necessary for growth from molecules in the soil, water and air. However, unlike animals, they are not able to actively take in more nutrients in the form of food, so they need an alternate source of energy to create the chain reactions that break down the bonds of molecules to create energy for each cell. This energy comes from the sun, and plant cells are able to harness it using a chemical called chlorophyll, which enables photosynthesis.