Cutting or shaving the hair is one of the obligatory rites of Hajj and Umrah as a sign of ending one’s state of Ihram.
The Muslim jurists are unanimously agreed that shaving the entire head is preferable to cutting the hair, because it is proven that the Messenger of Allah (peace and blessings be upon him) shaved his entire head, and he prayed for those who shaved their heads three times, and for those who cut their hair once.
However, they differed as to the minimum amount that is acceptable in shaving the head or cutting the hair. The most preferable opinion is that whoever shaves his head or cuts his hair, should do that to his entire head; it is not sufficient to limit it to only part of it. As for the women, they only need to shorten or trim their hair.
Shaving the head or cutting the hair is not necessary to be done within the haram boundary. After finishing the rites of Umrah, one may shave his head or cut his hair anywhere to end his Ihram.