Disclaimer: I'm not a lawyer; everything in this comment is my opinion and/or based on things that I have found on the internet or vaguely remembered from legal notices posted around my workplace. EDIT: Also this is only about things in the USA--I do not know how it works elsewhere.
Short answer: You can't go home early because if you don't put in the time your employer requires of you they can fire you!
Longer answer: The 40 hour work week is set forth in the Fair Labor Standards Act (FLSA). All that the FLSA says is that depending on what kind of work you do, your employer may or may not be required to compensate you for overtime. Your employer is allowed to set your work hour requirements, but if you are considered "non-exempt" from the FLSA, then if you work more than 40 hours your employer is required to provide time-and-a-half compensation for the extra hours worked. Many positions in tech are, I think, generally "exempt" from the FLSA's overtime rule (software dev types, at least--I'm less sure about ops/IT services folks) and therefore employers are not required by law to compensate software developers for overtime.
The FLSA does not address whether or not an employer can require you to work more or less or exactly 40 hours per week; it's all about what obligations they take on if you are non-exempt and they do require you to work more than 40 hours per week.
Short answer: You can't go home early because if you don't put in the time your employer requires of you they can fire you!
Longer answer: The 40 hour work week is set forth in the Fair Labor Standards Act (FLSA). All that the FLSA says is that depending on what kind of work you do, your employer may or may not be required to compensate you for overtime. Your employer is allowed to set your work hour requirements, but if you are considered "non-exempt" from the FLSA, then if you work more than 40 hours your employer is required to provide time-and-a-half compensation for the extra hours worked. Many positions in tech are, I think, generally "exempt" from the FLSA's overtime rule (software dev types, at least--I'm less sure about ops/IT services folks) and therefore employers are not required by law to compensate software developers for overtime.
The FLSA does not address whether or not an employer can require you to work more or less or exactly 40 hours per week; it's all about what obligations they take on if you are non-exempt and they do require you to work more than 40 hours per week.