If you are working 9-5, you are probably a low wage hourly grunt. Anyone with a decent qualification will be salaried, with a nominal 40 hour week, but will be expected to work the hours demanded by the job. The guys who arrive at 9:01 am and scramble for the door at 5:01 pm never get promoted, and are still sitting in a cubicle doing grunt work at age 60. See "Wally" in the Dilbert cartoon strip.
When you are starting out as an engineer, you are more likely to have to put in about 50 hours per week (not 40); when you've been on the job for a while, and if you're good at your job, you may be able to trim your hours towards 40.
It's more of a metaphor for putting in a mundane 8 hour day. If you're an engineer, you'll put in a lot more time than 8 hours/day unless you have a mundane paperwork job.
Many companies have flex hours which means you can set your working hours, within reason.
We have people that come in a 5am and leave at 3 to 4 pm. I come in at noon and leave at 10 to 11pm.
For me I keep my mind working on a project pretty much all the time. Sometimes I sit behind my desk, but otherwise I can watch a movie, go on a hike, and when I've solved my problem I write it down.