I take that statement to mean it's a compliment, so when you say "thank you," you're basically thanking them for noticing your length (at least that's how I feel).
That is how I view it and it is a compliment. Since when someone telling another that her hair is long is anything but a compliment. We all know that long is beautiful and a trait of beauty. I remember a while ago I was watching ricky lake and one of her guess had thick, thigh length hair and Ricky Lake said "beautiful hair." It was indeed a compliment.