We characterize the thermal conductivity of graphite, monolayer graphene, graphane, fluorographane, and bilayer graphene, solving exactly the Boltzmann transport equation for phonons, with phonon-phonon collision rates obtained from density functional perturbation theory. For graphite, the results are found to be in excellent agreement with experiments; notably, the thermal conductivity is 1 order of magnitude larger than what found by solving the Boltzmann equation in the single mode approximation, commonly used to describe heat transport. For graphene, we point out that a meaningful value of intrinsic thermal conductivity at room temperature can be obtained only for sample sizes of the order of 1 mm, something not considered previously. This unusual requirement is because collective phonon excitations, and not single phonons, are the main heat carriers in these materials; these excitations are characterized by mean free paths of the order of hundreds of micrometers. As a result, even Fourier's law becomes questionable in typical sample sizes, because its statistical nature makes it applicable only in the thermodynamic limit to systems larger than a few mean free paths. Finally, we discuss the effects of isotopic disorder, strain, and chemical functionalization on thermal performance. Only chemical functionalization is found to play an important role, decreasing the conductivity by a factor of 2 in hydrogenated graphene, and by 1 order of magnitude in fluorogenated graphene.