The Perseus galaxy cluster was observed by the MAGIC Cherenkov telescope for a total effective time of 24.4 hr during 2008 November and December. The resulting upper limits on the gamma-ray emission above 100 GeV are in the range of 4.6 to 7.5 x 10^{-12} cm^{-2} s^{-1} for spectral indices from -1.5 to -2.5, thereby constraining the emission produced by cosmic rays, dark matter annihilations, and the central radio galaxy NGC1275. Results are compatible with cosmological cluster simulations for the cosmic-ray-induced gamma-ray emission, constraining the average cosmic ray-to-thermal pressure to <4% for the cluster core region (<8% for the entire cluster). Using simplified assumptions adopted in earlier work (a power-law spectrum with an index of -2.1, constant cosmic ray-to-thermal pressure for the peripheral cluster regions while accounting for the adiabatic contraction during the cooling flow formation), we would limit the ratio of cosmic ray-to-thermal energy to E_CR/E_th<3%. The upper limit also translates into a level of gamma-ray emission from possible annihilations of the cluster dark matter (the dominant mass component) that is consistent with boost factors of ~10^4 for the typically expected dark matter annihilation-induced emission. Finally, the upper limits obtained for the gamma-ray emission of the central radio galaxy NGC1275 are consistent with the recent detection by the Fermi-LAT satellite. Due to the extremely large Doppler factors required for the jet, a one-zone synchrotron self-Compton model is implausible in this case. We reproduce the observed spectral energy density by using the structured jet (spine-layer) model which has previously been adopted to explain the high-energy emission of radio galaxies.