After this, Paul stayed many days longer and then took leave of the brothers and set sail for Syria, and with him Priscilla and Aquila. At Cenchreae he had cut his hair, for he was under a vow. (Acts 18:18, ESV)
A theme repeated consistently throughout Acts of the Apostles is that the Jews unfairly attack Paul for not following Jewish religious laws. In each case, Acts defends Paul by providing evidence that he was a loyal Jew, even if the defence sometimes seems contrary to what Paul states in his epistles to be his beliefs, including that Christians are not under Jewish law.
The vow in Acts 18:18 that required Paul to cut his hair would be the Nazarite vow that is stipulated in Numbers 6:1-21. Referring to claims that Paul taught his followers to abandon the Mosaic laws, Dennis E. Smith and Joseph Tyson say, in Acts and Christian Beginnings, page 225, "Luke intends to show that this is a false charge, and the taking of a vow of special devotion is probably intended to support the image of Paul as a faithful Jew."
Good question, and you'll find that in answering it you will wind up with far more questions than answers.
The starting place, is of course, the Tenakh, what you may have been told is the "Old" Testament. Shaul was a man who was a slave to righteousness (Romans 6:18), and a prisoner for Jesus the Christ, or for the Gospel (Eph 3:1. but also Zechariah 9:12)
Short of two other occasions, is there ever a precedent where the head of someone follow G-d was shorn? The one occasion is he who has contracted leprosy, in order to be fully diagnosed and then as a condition of being declared clean, the head was shaved. The other instance which may or may not pan out--though if memory serves-- instances of extreme mourning. Since neither of these two qualify as a vow, nor are even alluded to, we must conclude that Shaul had voluntarily undertaken a Nazirite vow.
There is more I will add later, time permitting.