whilst under any form of stress (physical, emotional, physiological eta) your body will go into a Catabolic state (mostly from cortisol release).
whilst under any form of rest (sleeping, sitting on the couch, meditating) your body will go into a Anabolic state.
your net mass will always equal: storgage + energy in - energy out
if you are chronically stressed (over exercise, uptight eta) you will not be able to build much muscle (example: marathon runner) and most of your excess calories will go to fat. As you reduce stress you'll be able (if you do some form of resistance training) to more build muscle.
your question completely depends on lifestyle and genetics - particularly cortisol and testosterone levels and your satellite cells. a million different people (or even the same people but in parallel universes with different life styles) can do exactly what you just described and get completely different results.