My last software job was supposedly 40 hours/week. I'd usually come in for two hours and leave. They wouldn't be an intense two hours either. Once in a while I'd stay all day. Based on what I hear from my friends from university, this experience is not the median but it's not uncommon either.
Many managers really don't know how to manage. Morale goes down the shitter, and unless you have children it's unlikely you'll care about getting caught.