Future instruments like NIRCam and MIRI on JWST or METIS at the ELT will be able to image exoplanets that are too faint for current direct imaging instruments. Evolutionary models predicting the planetary intrinsic luminosity as a function of time have traditionally concentrated on gas-dominated giant planets. We extend these cooling curves to Saturnian and Neptunian planets. We simulate the cooling of isolated core-dominated and gas giant planets with masses of 5 Earthmasses to 2 Jupitermasses. The luminosity includes the contribution from the cooling and contraction of the core and of the H/He envelope, as well as radiogenic decay. For the atmosphere we use grey, AMES-Cond, petitCODE, and HELIOS models. We consider solar and non-solar metallicities as well as cloud-free and cloudy atmospheres. The most important initial conditions, namely the core-to-envelope ratio and the initial luminosity are taken from planet formation simulations based on the core accretion paradigm. We first compare our cooling curves for Uranus, Neptune, Jupiter, Saturn, GJ 436b, and a 5 Earthmass-planet with a 1% H/He envelope with other evolutionary models. We then present the temporal evolution of planets with masses between 5 Earthmasses and 2 Jupitermasses in terms of their luminosity, effective temperature, radius, and entropy. We discuss the impact of different post formation entropies. For the different atmosphere types and initial conditions magnitudes in various filter bands between 0.9 and 30 micrometer wavelength are provided. Using black body fluxes and non-grey spectra, we estimate the detectability of such planets with JWST. It is found that a 20 (100) Earthmass-planet can be detected with JWST in the background limit up to an age of about 10 (100) Myr with NIRCam and MIRI, respectively.