Gaussian basis sets for correlated wave functions. Hydrogen, helium, first- and second-row atoms