It's not so much the length of your workout, it's how hard you push yourself. Yes, a lack of sleep is one of many factors that can release extra cortisol. Also, although I can't remember the details of the study, lack of sleep also adds BF because you have a harder time processing carbs.