Her long hair is what Gothel wants — Gothel doesn't give a crap about the girl, just the hair. So Flynn cuts her hair — even at the cost of risking his own life — because he knows it is the only way to free her, and he wants to make certain she is free before he dies.