This image is from Meta Stack Overflow's chat room not available page.
Is it from an actual episode, or is it a 'shop?
Definitely photoshopped. Worf's sash being silver and not frayed cheap table-cloth-material gold makes it at least 2nd season, but the uniforms make 3rd season or later.
--added for specificity and background--
The simplest way to check this is to go to http://startrek.com and look at stills for ST:TNG episode summaries.
I don't remember all the details, but after the first (or second) season Patrick Stewart threatened to sue Paramount because the one-piece jumpsuits were so tightly fitted they put excessive pressure on their shoulders and spines. There was an initial change to respond to that issue, then another later change. While I wasn't able to tell, off the top of my head, when the changes were made, I went to http://startrek.com and checked stills in episode summaries to verify the uniforms. There's one style in 1st season (the all-in-one), it's changed for 2nd season, and in 3rd season and alter are the simpler collars without the diamond shaped shoulder "pads," just as seen in this image.
I'm re-watching the series at the moment, and I think I have found the scene where that image was originally taken from:
This is in the teaser for Q Who - and the reason they're all looking in different directions is that an annoying high-pitched noise has started on the bridge, so they're all looking for the source. Turns out, this noise is heralding the arrival of a very naked Q.
The hats are most certainly shopped in - as for the rest of the image, the more I look at it, the more it seems to be a composite. Picard, Riker and Worf are all looking in different directions - which would look a bit silly on TV, although this could just be a momentary thing.
It's also possible that the photo is a promotional image - it has that kind of look to it.
I've tried quite a bit of google image search, and cannot turn up anything that could be the original (the problem is - there are so many shots of these three on the bridge).
Still - judging by the uniforms, I'd say this is probably somewhere in season 3-5 - so if someone is watching these at the moment, they might spot them.
Photoshopped. To me, it looks like Worf's and Picard's hats are the same, while Riker's is mirrored and then edited a bit.
The hats are likely to be a reference to Firefly -- Jayne's hat from the episode The Message, although the colours aren't quite right.
I couldn't speak for the rest of the image, although even without the hats, the expressions do seem a bit odd, don't they?