Experiments looking for rare events like the direct detection of dark matter particles, neutrino interactions or the nuclear double beta decay are operated deep underground to suppress the effect of cosmic rays. But the production of radioactive isotopes in materials due to previous exposure to cosmic rays is an hazard when ultra-low background conditions are required. In this context, the generation of long-lived products by cosmic nucleons has been studied for many detector media and for other materials commonly used. Here, the main results obtained on the quantification of activation yields on the Earth's surface will be summarized, considering both measurements and calculations following different approaches. The isotope production cross sections and the cosmic ray spectrum are the two main ingredients when calculating this cosmogenic activation; the different alternatives for implementing them will be discussed. Activation that can take place deep underground mainly due to cosmic muons will be briefly commented too. Presently, the experimental results for the cosmogenic production of radioisotopes are scarce and discrepancies between different calculations are important in many cases, but the increasing interest on this background source which is becoming more and more relevant can help to change this situation.