They are given names. Magdalene was where she came from or resided, IIRC, Woman of Galilee.
I don’t know how they kept it all straight. Last names did make it more simple than calling everyone of their Father, town or profession!
Most western last names are based on a father, location, or profession.
There weren’t nearly as many people back then, and not everybody “counted.” Many of our family names are obviously references to places or occupations. I think it was whatever somebody was named when written records came into vogue. Obviously the Romans kept written records for taxation and registration purposes. Remember, it was for a census that Joseph and Mary had to travel to Bethlehem.