It's kind of complicated to explain in a post (and it depends on which software you use), but...
You would create the text on two layers (by duplicating one layer) and put the photo layer between the two. Then select the photo layer image with your selection tool. The selection should not include the torn part of the edge. Once you have the "marching ants" around the photo, select the top text layer, invert the selection and delete the inverted selection. This will remove the lower part of the text, exposing the torn edge.
That should do it...
HTH!