1.Open new document
Open new document, Write any word.
After that open an image.
Copy the image.
Now, press Ctrl + Click on thumbnail of text layer, So you’ll have a dotted line around the word.
Go to Edit > Paste special > Paste into. You’ll have a text with background like this.
You can change the size of image by Ctrl + T.