According to human right, you can of course keep your hair long
Article 28 of the Convention on the Rights of the Child
2. States Parties shall take all appropriate measures to ensure that school discipline is administered in a manner consistent with the child’s human dignity and in conformity with the present Convention.