We demonstrate the controlled generation of Fock states with up to 15 photons in a microwave coplanar waveguide resonator coupled to a superconducting phase qubit. The subsequent decay of the Fock states, due to dissipation, is then monitored by varying the time delay between preparing the state and performing a number-state analysis. We find that the decay dynamics can be described by a master equation where the lifetime of the n-photon Fock state scales as 1/n, in agreement with theory. We have also generated a coherent state in the microwave resonator, and monitored its decay process. We demonstrate that the coherent state maintains a Poisson distribution as it decays, with an average photon number that decreases with the same characteristic decay time as the one-photon Fock state.