From the IRS website:
Here are five tips from the IRS for recently married or divorced taxpayers who have a name change.
1. If you took your spouse’s last name -- or if you hyphenated your last names, you may run into complications if you don’t notify the SSA. When newlyweds file a tax return using their new last names, IRS computers can’t match the new name with their Social Security number.
2. If you recently divorced and changed back to your previous last name, you’ll also need to notify the SSA of this name change.
3. Informing the SSA of a name change is easy. Simply file a Form SS-5, Application for a Social Security Card, at your local SSA office or by mail and provide a recently issued document as proof of your legal name change.
4. Form SS-5 is available on SSA’s website at https://www.ssa.gov/, by calling 800-772-1213 or at local offices. Your new card will have the same number as your previous card, but will show your new name.
5. If you adopted your spouse’s children after getting married and their names changed, you'll need to update their names with SSA too. For adopted children without SSNs, the parents can apply for an Adoption Taxpayer Identification Number – or ATIN – by filing Form W-7A, Application for Taxpayer Identification Number for Pending U.S. Adoptions with the IRS. The ATIN is a temporary number used in place of an SSN on the tax return. Form W-7A is available on the IRS.gov website or by calling 800-TAX-FORM (800-829-3676).