Exploiting the H-ATLAS Science Demonstration Phase ( SDP ) survey data , we have determined the luminosity functions ( LFs ) at rest-frame wavelengths of 100 and 250 \mu m and at several redshifts z \gtrsim 1 , for bright sub-mm galaxies with star formation rates ( SFR ) \gtrsim 100 M _ { \odot } \mathrm { yr } ^ { -1 } . We find that the evolution of the comoving LF is strong up to z \approx 2.5 , and slows down at higher redshifts . From the LFs and the information on halo masses inferred from clustering analysis , we derived an average relation between SFR and halo mass ( and its scatter ) . We also infer that the timescale of the main episode of dust-enshrouded star formation in massive halos ( M _ { H } \gtrsim 3 \times 10 ^ { 12 } M _ { \odot } ) amounts to \sim 7 \times 10 ^ { 8 } yr . Given the SFRs , which are in the range 10 ^ { 2 } -10 ^ { 3 } M _ { \odot } \mathrm { yr } ^ { -1 } , this timescale implies final stellar masses of order of 10 ^ { 11 } -10 ^ { 12 } M _ { \odot } . The corresponding stellar mass function matches the observed mass function of passively evolving galaxies at z \gtrsim 1 . The comparison of the statistics for sub-mm and UV selected galaxies suggests that the dust-free , UV bright phase , is \gtrsim 10 ^ { 2 } times shorter than the sub-mm bright phase , implying that the dust must form soon after the onset of star formation . Using a single reference Spectral Energy Distribution ( SED ; the one of the z \approx 2.3 galaxy SMM J2135-0102 ) , our simple physical model is able to reproduce not only the LFs at different redshifts > 1 but also the counts at wavelengths ranging from 250 \mu m to \approx 1 mm . Owing to the steepness of the counts and their relatively broad frequency range , this result suggests that the dispersion of sub-mm SEDs of z > 1 galaxies around the reference one is rather small .