Activate the Transform tool (Ctrl/Cmd+T or Edit > Free Transform) then set the horizontal skew value to 45º. The horizontal skew setting is located in the options bar when you have your Transform tool activated. Press Enter to apply the transformation.
Read more at http://www.photoshoptutorials.ws/photoshop-tutorials/special-effects/quick-tip-create-triangle-pixelation-effect-photoshop/#X0s0z4u8ScMckZyz.99