The reality is that long hair ranks alongside visible tattoos, scruffy clothes, piercings and any number of other fashion choices (ie. points of appearance that are very much within your control).
In all these cases, I have never seen a study which shows a correlation between fashion choices and professionalism. In my personal experience, I have also never seen a correlation between fashion choices and professionalism. I strongly contend that there is no correlation.
However, none of that matters. The fact of the matter is that some of your customers will assume a correlation between fashion choices and professionalism, even if none exists.
I used to have long hair at your age, but I was never customer-facing and nature took its course long before I was forced into cutting it short. I have tattoos but they are covered whenever I'm in the office, certainly whenever I'm facing a customer. I have deliberately had my tattoos in places that are usually covered.
Because I know that I'm professional, people who work with me know that I'm professional, but others don't, and I have to accept that society is such that someone may make an incorrect assumption based on my visible personal choices.
(I guarantee you that at least one person is already thinking about responding with a comment about tattoos being an indication of my poor judgement and that they wouldn't want to deal with me based on that alone. Some might even judge me for having a beard. But I'm lucky enough to be marketable and can ignore those people.)
Sadly, if you're going to be in retail, your bosses have every right to suggest that you will appear more professional to your customers if you keep your hair reasonably short. It stinks, I know, but they do. Because it doesn't matter what you or I think, if one customer walks away because of their assumptions, the business has lost out because you didn't cut your hair.
Most people, nowadays, simply don't care. But no one ever assumed that someone was unprofessional because they have short hair, no tattoos or piercings, were clean-shaven and wore a nice smart suit. (Except a tattoo artist, of course, to pick a rare example.)