Bismillāhir Raḥmānir Raḥīm
The general rule:
While in the state of iḥrām, a person is generally not allowed to cut his own hair or that of any other person. If he does, he will be liable to pay a penalty.
The exception:
However, the following case is an exemption to this general rule:
A muḥrim is allowed to cut the hair of his head or the hair of another person’s head to exit the state of iḥrām when he has completed all the rituals (manāsik) of:
a. Ḥajj on the 10th of Dhul Ḥijjah, after the ramī (in the case of Ḥajj Ifrād) or after the ramī and dhabaḥ (in the case of Ḥajj Tamattuʿ and Qirān)
b. ʿUmrah (after the ṭawāf and saʿī).
Note:
In this final state of iḥrām, the person is only allowed to cut the hair of the head. He is not allowed to cut or shave any other hair (like the beard or underarm hair etc.). After he cuts the hair of his head, cutting the hair from any other area is permitted.
And Allāh Taʿālā knows best.
[References: Al-Baḥr ʿAmīq (2/861-865), Manāsik Mullā ʿAlī Qārī (pg.324, 466-468), Irshādus Sārī (pg.467), Ghunyatun Nāsik (pg.402-404, 279), Fatāwā Raḥīmiyyah (3/115), Aḥsanul Fatāwā (4/522), Anwār Manāsik (pg.527), Kitābul Masāʾil (3/341), Al-ʿAjj wal Thajj (pg.41)]