Gotra of women will change from her father's Gotra to husband's Gotra. How this will happen? Is there any Mantra?
The Hindu Gotra System – Male Lineage Identification
The Gotra is a system which associates a person with his most ancient or root ancestor in an unbroken male lineage. For instance if a person says that he belongs to the Bharadwaja Gotra then it means that he traces back his male ancestry to the ancient Rishi (Saint or Seer) Bharadwaja. So Gotra refers to the Root Person in a person’s male lineage.
This Gotra system helps one identify his male lineage and is passed down automatically from Father to Son. But the Gotra system does not get automatically passed down from Father to Daughter. Suppose a person with Gotra Angirasa has a Son. Now suppose the Son gets married to a girl whose father belongs to Gotra Kashyapa. The Gotra of the girl automatically is said to become Angirasa after her marriage even though her father belonged to Gotra Kashyapa.
So the rule of the Gotra system is that the Gotra of men remains the same, while the Gotra of the woman becomes the Gotra of their husband after marriage. Now suppose a person has only daughters and no sons. In that case his Gotra will end with him in that lineage because his daughters will belong to the Gotras of their husbands after their marriage!
This was probably the reason why in the ancient Vedic or Hindu societies it was preferred to have at least one Son along with any number of daughters, so that the Gotra of the father could continue.
We may think that the Gotra system is a little biased as it focusses mainly on male lineages. However there's a little science behind it:
Y Chromosome is the only Chromosome which gets passed down only between the men in a lineage. Women never get this Y Chromosome in their body. And hence Y Chromosome plays a crucial role in modern genetics in identifying the Genealogy ie male ancestry of a person. And the Gotra system was designed to track down the root Y Chromosome of a person quite easily. If a person belongs to Angirasa Gotra then it means that his Y Chromosome came all the way down over thousands of years of timespan from the Rishi Angirasa! And if a person belongs to a Gotra (say Bharadwaja) with Pravaras (Angirasa, Bhaarhaspatya, Bharadwaja), then it means that the person’s Y Chromosome came all the way down from Angirasa to Bhaarhaspatya to Bharadwaja to the person.
This also makes it clear why females are said to belong to the Gotra of their husbands after marriage. That is because women do not carry Y Chromosome, and their Sons will carry the Y Chromosome of the Father and hence the Gotra of a woman is said to be that of her husband after marriage. Pretty neat isn’t it? All iz well so far, we now know the science behind the Gotra System. The ancient vedic Rishis hence very well knew the existence of the Y Chromosome and the paternal genetic material that was passed almost intact from father to Son, and hence created the Gotra system to identify their male lineages. Lord Buddha for instance belonged to Gautama Gotra which means that Buddha was a direct descendant of Rishi Gautama.
I don't think there are any mantras to change Gotras as it means going against the nature (creation/genes) but we do have vedic mantras chanted during Kanyadan.