There's a maximum 48 hour work week, which the employee can opt out of. That 48 hours is normally averaged over 17 weeks. (I have no idea what happens if an employer tries to use median or modal instead of mean). But the employee can not opt out of the other requirements.
The 48 hour maximum doesn't cover people who control their own working hours (ie, start up founder); the armed forces, the police, and the emergency services, in some circumstances; domestic staff living in a household; some boat crew.
Trainee doctors used to be exempt. They're now covered, but averaged over 26 weeks.
Some staff are not allowed to opt out - airline pilots for example.
Workers can opt in and opt out of the arrangement, but they must give some notice if they had previously opted out and now want to opt in.
And all of this is for workers over the age of 18 - 16 and 17 year olds can only work for 8 hours a day or 40 hours a week with no averaging.
Arbeidsmiljøloven (the Law of Workers' Environment) is one of the strongest pieces of legislation in the world to prevent exploitation of laborers. This law has to be followed by everyone who doesn't have an exemption after an agreement between large groups of employers and employees. Basically, most of the nation has the advantages of unionized labor without the big disadvantages (rent-seeking, destructive bureaucratic processes, low productivity).
I live in the UK and work in IT and have never had a contract that didn't automatically opt me out of it, however my wife is a doctor and they're all covered by it so work a maximum of 48 hours.
Worth noting that it's averaged over time rather than a set maximum for an individual week.
Also worth noting that individual countries can have stricter policies. I believe France has a lower maximum.
Major law firms, for example, where the expected level of billable hours might eek in below an average of 48 hours, but given the amount of non-billable time, it's basically impossible to meet expectations and get promotions if you don't opt out, and you'll eventually find yourself sidetracked so thoroughly there's little reason to stay.
My ex works in one of those places - one of the magic circle law firms -, and she keeps fantasising about opting back in once she's set aside enough money that she can risk having legal career go down in flames.
I live in the UK too, and work in IT, and have never seen a contract that even mentions the working hour directive at all. If I did come across one, I'd probably laugh in their faces and leave, as it'd indicate bad things about the working environment to me.
At the moment I work strictly 9-5 due to childcare commitments (though I do occasionally have to handle emergencies from home). As in, I leave between 5pm and 5.04pm or so, every day.
That would probably fall foul of the regulations.
Worth noting too that the average of 48 hours a week is calculated over 17 weeks so under even under a WTD compliant agreement you could have someone work a month of 60 hour weeks so long as you reverted to 40 hour weeks for a while after to bring the average back down.
Does the rule apply to an individual or just to the individuals employment at a particular company?
For example can a person work 40 hours for company A and then 20 hours of company B, in which case can company B take on work contracts from company A using the same employee (who may or may not be the owner of company B)?