In a recent interview with Entertainment Weekly on Facebook, McGregor explained how Obi-Wan's haircut changes depending on his outlook on life, and where the character is mentally. The youngest version we get to see hails from "The Phantom Menace," and the character of Obi-Wan is still a padawan under the tutelage of Qui-Gon Jinn (Liam Neeson). McGregor explained that he wasn't sure if it was established that padawans have haircuts like that, but went on to say that they were going for a military or a monk type of aesthetic. Padawan haircuts are marked by the small braid on the back of the head, and short, cropped hair.
McGregor then went on to explain Obi-Wan's haircut in "Attack of Clones," and said that the working name the crew used to describe it was "the Jedi mullet." This version sees Obi-Wan's hair significantly longer than his "Phantom Menace" cut, while also donning some facial hair. He noted that the hair was meant to illustrate the growth of Obi-Wan, and how he was coming into his own, but the actor himself did not particularly enjoy the look of it, and said that it reminded him of the Bee Gees.
When it comes to "Revenge of the Sith," McGregor said that the production crew looked at Alec Guinness' Obi-Wan, and tried to combine the two looks together. This movie sees Obi-Wan's hair cut short, and it definitely looks like they were headed in the right direction with the natural progression of the character, and now with the upcoming "Obi-Wan" show on Disney+, we get to see Obi-Wan grow increasingly unkempt, mirroring the character's internal struggle. So, according to McGregor, Obi-Wan's hair itself tells a story.