Usually, when two slave owners get married, slaves are a gift to the couple from the woman's family. Because they are from the wive's side of the family, they will take the last name if the wife's father.
Slaves were not allowed to use the same name as a child of their master for their own child. If they did this they were harshly beaten.
Former slaves sometimes made up a last name based on what they did for a living. For example, a slave from Wessyngton was called Billy the Smith because he was a blacksmith. After the emancipation, he became William Smith.
Works Cited
http://www.wessyngton.com/blog/2009/08/surnames-used-by-african-american-slaves/
https://en.m.wikipedia.org/wiki/List_of_the_most_popular_names_in_the_1880s_in_the_United_States
http://nameberry.com/list/383/Early-African-American-Names
http://babynames.allparenting.com/babynames/Ideas/Early_African-American_baby_names_for_boys_and_girls/
https://etd.ohiolink.edu/rws_etd/document/get/osu1338404929/inline
http://www.salon.com/2008/08/25/creative_black_names/
https://democracychronicles.com/origins-black-name/