We investigate the clustering of afterglow light curves observed at X-ray and optical wavelengths. We have constructed a sample of 61 bursts with known dis tance and X-ray afterglow. This sample includes bursts observed by BeppoSAX, XMM-Newton, Chandra, and SWIFT. We correct the light curves for cosmological ef fects and compare the observed X-ray fluxes one day after the burst. We check for correlations between the observed flux and the burst spectral and temporal properties. We confirm the previous result of Boer and Gendre (2000) that X-ray afterglow light curves cluster in luminosity, even when we consider the l ast SWIFT data. We observe this clustering only for the afterglow light curves; the inclusion of prompt-related data broaden the distribution. A similar clu stering is observed for the optical light curves; GRB sources can be divided in three classes, namely optical and X-ray bright afterglows, optical and X-ray dim ones, and optically bright -X-ray dim ones. We argue that this clustering is related to the fireball total energy, the external medium density, the fraction of fireball energy going in relativistic electrons and magnetic fields. These parameters can be either fixed to a standard va lue, or correlated. We finally propose a method for the estimation of the GRB source redshift based on the observed X-ray flux one day after the burst and optical properties. Using this method, we compute a redshift of 1.4 +/- 0.2 for GRB 980519 and of 1.9 +/- 0.3 for GRB 040827. We tested this method on three recently detected SWIFT GRBs with known redshift, and found it in good agreement with the reported distance from optical spectroscopy .