Certainly in the 1950s/60s when I was at school we were expected to have "short back and sides" ,Teddy boy and mod styles and others were told to get it cut. I remembered one boy who had a crew cut: the head told him "grow it"! By the time I was at University (1963-66)long hair was the norm, used to get mine cut once a term, the week before I returned home for the holidays! By 1970 when I got married long hair was OK for work (at least in Universities). My wedding photos make me cringe- I had sideburns Noddy Holder would have envied!
Having said that many actors seem unwilling to wear hairstyles to fit the period- very few get the right brutal short haircuts of the 1930s and 40s.