Context. Within the theoretical framework of some modern unification theories the constants of nature are functions of cosmological time. White dwarfs offer the possibility of testing a possible variation of G and, thus, to place constraints on these theories. Aims. We present full white dwarf evolutionary calculations for a scenario where G decreases with time. Methods. White dwarf evolution is computed in a self-consistent way, including the most up-to-date physical inputs, non-gray model atmospheres and a detailed core chemical composition that results from the calculation of the full evolution of progenitor stars. Results. We find that the mechanical structure and the energy balance of white dwarfs are strongly modified by a varying G. In particular, for a rate of change of G higher than Ġ /G = -1 × 10-12 yr-1, the evolution of cool white dwarfs is markedly affected. The impact of a varying G is more pronounced for more massive white dwarfs. Conclusions. In view of the recent results reporting that a very accurate white dwarf cooling age can be derived for the old and metal-rich open cluster NGC 6791, our study suggests that this cluster could be a potential target to constrain or detect a hypothetical secular variation of G.