So, the reason why I ask this is because in Thor: The Dark World you can clearly see that Loki's hair did grow but how can they grow so fast if he and Thor just teleported themselves straight to Asgard? Or does this take really long? Because when Loki went to his Father in Thor: The Dark World it looked like they saw each other for the first time since what happened in New York. I am so confused. I hope you guys can help me!
Based on the timeline provided on the MCU wikia, the Battle of New York happened on May 1, 2012, with Thor returning to Asgard with Loki on May 5. The timeline puts Loki's sentencing on the same day. The date of Loki's sentencing is from Thor: The Dark World Prelude, a comic book that covers time the time around The Avengers. It should be assumed that those are the same scene, because it would be bizarre if Odin sentenced Loki twice.
As for how Loki's hair grew, the Doylist explanation is that they weren't paying attention to his hair length and/or didn't think anyone would notice. Watsonian explanations include that Loki is a shapeshifter and decided to change his hair or that it's an illusion.