rasterize the text layer by doing right click>rasterize

create a new layer over the text layer, fill it with the gradient and apply a clipping mask (ctrl + alt +g)

there are other ways, but this is easiest . hope that helped.