That's what she said.

Seriously though.
When something someone said could be misconstrued as in any way sexual then "that's what she said" is relevant as an on the fly style joke.
Point and case, wood burning fireplace:
Person a: I'm just going to pop some more wood in
Person b: That's what she said
BOOM!
In this example, wood is being misconstrued as a commonly used slang term for an erection. So, popping some more wood into a fire can be another way of saying putting an erect penis into a vagina. Hence, that's what she said.
Also relevant is that alot of the time the "that's what she said" jokes make absolutely no sense, this is because people are idiots. But also because the joke it so popular it no longer has to make sense to be funny.
I hope this clarifies for you.
He just explained it all, It is just a derogatory saying when someone hears something thing sexual. The thing that makes it really funny is when it is something that a girl might actually "say that" to some guy.