It has something to do with cortisol, which is a stress hormone. I couldn't find much about weight gain in the general cortisol article on wikipedia, but the article on Cushing's syndrome, which is a severe case of high cortisol levels, talks about it a bit:
http://en.wikipedia.org/wiki/Cushing%27s_syndrome