Replacement social security cards, including name changes, are always free. You'll need the gold sealed certified final judgment from the court (court order), a valid picture id with current photo (passport, state id, driver's license), birth certificate (if born in PR you need to make sure you have the new ones that are blue bordered and have a water mark from the 2000s), and there was one more I believe but can't remember. They have a website with all of the information on their .gov site.
Court order unsure if you have to pay anything
Thanks! Your answer is awaiting moderation.