In Islam, it is neither haram (unlawful) nor required for a wife to change her last name to that of her husband. To understand this better, one must first understand one of the central aims (maqasid) of Shari’ah, which is the preservation of one's lineage (nasab). Changing one's lineage and ascribing oneself to other than one's biological father is a major sin in Islam. The Quran and Sunnah mention this explicitly.
The Messenger of Allah (Allah bless him and give him peace) adopted Zayd ibn Haritha (Allah be pleased with him); and according to common practice, the companions (Allah be pleased with them) began referring to him as “Zayd ibn Muhammad”. When the abovementioned verse was revealed, they reverted to calling him “Zaid ibn Haritha”. The verse was revealed to lay down the principle that an adopted child must not be considered as the real son of his adoptive parents.
However, this does not mean that the usage of any name or attribution after one’s name, besides that of the father, is unlawful. Rather, the Shari’ah prohibits ascribing one's lineage to other than one's biological father or claiming that someone else is one's biological father. This is unlawful because it misleads others, and also comprises showing ungratefulness to one's parents and denying them their basic right of parenthood.
Thus, a wife adopting her husband's surname after marriage is not unlawful as long as she clearly acknowledges her biological father and does not deny him fatherhood. If she retains her father's surname but verbally denies him fatherhood and informs others that someone else is the father, then that too would be unlawful.
It is also noteworthy to mention that many of the Prophet Muhammad's (peace be upon him) wives did not change their names after marriage, including Aisha bint Abu Bakir and Khadijah bint Khuwaylid,. Therefore, the idea that a woman must change her last name upon marriage is not rooted in Islamic tradition, but rather in cultural customs that vary from region to region.
In conclusion, both positions - that it is haram or that it is necessary for a wife to take her husband's surname - are incorrect. It is up to the wife to decide whether or not to take her husband's surname after marriage, as long as she does not claim fatherhood for another person.
Reference: Darul Iftaa