All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The Prophet had long hair till his shoulders; this is confirmed in a narration reported by Imaam Muslim but this was in accordance with people's customs and traditions and was not done an act of worship. Anyway, if one performs an act done by the Prophet that has a relation with the customs, but he did it with the intention of imitating the Prophet then he will be rewarded for doing so.
Nonetheless, it is not permissible to keep one's hair long in order to imitate the non-Muslims and dissolute people, or other evil purposes. The Prophet said: "Whoever imitates a people, he is one of them." [Abu Daawood] Also, Ibn 'Abbaas said: "The Prophet cursed men who imitate women." [Al-Bukhari]
As regards the order of the parents to their child to keep his hair short out of fear to imitate dissolute people, then the child is obliged to obey them since they did not order him to commit a sin, and since this does not cause him any harm. Ibn Taymiyyah said: 'A person is obliged to obey his parents even if they are dissolute as long as they do not order him to disobey Allaah; this is also the view of Imaam Ahmad. This is if there is an expected benefit for them and no expected harm as a result, and he is obliged to obey them even if it is difficult for him but it does not cause any harm on him, otherwise no [if he is harmed].'
It might be that Allaah will reward you more for obeying your parents than for imitating the Prophet in a matter related to the customs or he did habitually.
Allaah Knows best.