What "is" energy in sub-atomic particles? This question may be simple or not, I don't know but I can't find the answer anywhere. The electromagnetic spectrum is the range of light particles in different wavelengths and is supposed to be determined by its "energy". So my question is what exactly is the energy of a photon or an electron, I have heard a few different things like it is the vibration of a photon or electron that creates the energy of these two particles. I understand what energy is but what gives photons different energy levels is my question.
Edit: thanks this was very helpful, I just have one more question that goes along with this. I have looked at everything you all said and my question is, to find the energy of light you have to know its frequency (E=hf) then to find its frequency you need to know its wavelength (f=c/wavelength) but to find its wavelength you need to know its frequency (wavelength=c/f). So yes it is definitely a circular answer but if you didn't know the wavelength of the light how can you find its frequency. How do you find one if you don't know the other?
 A: The relevant formula is Einstein's:
$E^2 = p^2 c^2 + m^2 c^4$, 
where $E$ is energy, $p$ is momentum, $m$ is mass, $c$ is speed of light. If $p=0$ then the particle is at rest and we get the famous equation $E=mc^2$. For photons, $m=0$, and we get 
$E = pc = \hbar \omega$. Here $\hbar$ is Planck's (reduced) constant, and $\omega$ is the angular frequency.
For the case of a photon, you can think of the energy as a measure of how fast it's internal clock "rotates". This is explained very nicely in Feynman's QED: A strange theory of light and matter.
A: The answer  by Surgical Commander covers the title question. I will address

what gives photons different energy levels is my question.

The creation of light in Classical Electrodynamics, no photons, is continuous. Macroscopically it was observed and the theory fitted the data that the acceleration of charges, i.e. giving increasing energy to a charged particle, generated light waves. CE was sufficient to describe observations until black body radiation  and the photoelectric effect came along and photons had to be invented. Photons were defined of energy =h*nu in order to explain the observations. I.e. light was not a continuous creation from energy input, but came in quanta, packets of fixed energy acting as particles. Quantum mechanics describes how this happens mathematically , and this has been confirmed experimentally an innumerable number of times.
The electrons around the atoms are in specific bound states with a well defined energy level. If they are in a higher energy level they decayed to a lower one releasing a photon with the energy difference as h*nu, creation of photon. A photon with the appropriate energy would give it up to a lower level electron and kick it up to a higher energy, it became absorbed.
This explained the atomic spectra , i.e. light from specific atoms, which were not continuous, as expected classically,  but came with specific frequencies, identified with  photons, of E=h*nu. (Classically an electron would be attracted to the nucleus emitting continuous energy from the acceleration of falling in).
So photons have different energies because they have been generated with differing boundary conditions of the quantum mechanical problem. They keep their identity until they interact with atoms/molecules and are absorbed in giving up their energy kicking electrons up to higher energy levels.
A: Not necessarily simple. I don't really know what energy is. 
Energy is conserved. This makes us think of it as some sort of "stuff" that can be changed from one type to another, but never created or destroyed. This is sometimes a good way to think of it, but not always. 
You can talk about the velocity of an electron, but it isn't really right. You are really talking about the velocity of an electron in a given frame of reference, or relative to a given observer. You can get any value for velocity (up to c) by choosing another frame of reference. Length is similar. An observer at rest with respect to an object measures one length. A moving observer measures another. 
Likewise kinetic energy can have any value. Just choose the right observer. So "stuff" isn't always the right way to think of energy. 

Length and velocity are the space-like components of length and velocity 4-vectors. These have fixed magnitudes. The length 4-vector is simple in the rest frame. It is the length unaffected by motion, or perhaps when motion is purely in the time-like direction. Likewise, the magnitude of the 4-velocity is c.  
If you multiply the 4-velocity of an object by its mass, you get the 4-momentum, whose magnitude is mc. The time-like component is E/c, where E is the energy of the object. This leads to $E^2 = p^2c^2 + m^2c^4$. 
But this isn't entirely kinetic energy. In the rest frame, when kinetic energy is 0 and velocity is entirely time-like, this leads to $E = mc^2$. So is this some sort of kinetic energy of motion in the time-like direction?
Because of this equation, it is sometimes said that mass and energy are equivalent. But mass is not always conserved in particle interactions. When an electron and positron annihilate, the reaction product is two gamma rays. The mass is now 0, but the energy did not change. So this conception of energy isn't satisfactory either. 

The energy of an isolated object isn't useful. If the universe contained just one electron, there wouldn't be much point to defining it's kinetic energy. 
When one electron collides with another (or repels another), the masses are equal, so the relative velocity is all that matters. 
It is somewhat artificial to choose a frame of reference, find the energies and momenta in that frame, and use them to calculate the outcome. You get the same outcome no matter what frame of reference you choose. Or equivalently, no matter what energy you choose. In that sense, energy is a fiction. 
Perhaps it is just an accounting system. In a given frame of reference, the numbers before and after an event always add up to the same value. 

When a photon strikes an electron, they both recoil. A large energy produces a large change in electron velocity. The velocity of the photon is of course always c. 
As before, energy depends on frame of reference. In a given frame of reference, both electron and photon have definite energies (ignoring the uncertainty principle.) even though all photons travel at c, they don't all have the same energy. Short wavelength photons have more energy and kick harder. 
An electron with an upstream velocity sees a blue shifted photon. It sees more energy in the electron. 
Two sufficiently short wavelength gamma rays can collide and create an electron-positron pair. In a different frame of reference, one is red shifted to a radio wave and the other a much more energetic gamma ray. They still can generate an electron-positron pair. 
