Spectral characterizations of graphs with at most two (signless) Laplacian eigenvalues greater than 2