A photo is put as a layer to a much bigger canvas to get some working room. Then the photo has been split by making a selection with the polygonal lasso. A part was cut & pasted to another layer and rotated 90 degrees:

The moved part is distorted to make the seam fit:

I found it was easiest to skew the piece and continue with Edit > Transform > Distort.
Much manual edits is needed to make some well visible objects nicely bent on the seam. My image hasn't such elements except the mountains in the background. They are left with a hard edged joint. The layers must be merged before edits on the seam.
It was surprising how little was left in the vertical part if it wasn't originally much bigger than the non-processed part. Also the loss of details is remarkable, something much sharper than a screenshot (this was one from Wikipedia) is needed as a starting point if the result must be acceptable on the screen.