First off, only the highborn bastards received their special surnames that is to say to those who are at least acknowledged by their highborn parent(s) or claim to be bastards of some noble e.g. Donnel Hill or Glendon Flowers. The unacknowledged bastards are no different from commonfolk who have no last names e.g. Gendry.
If a bastard is not legitimized, they will carry their bastard surname for their entire life. If they are legitimized, they adopt the name of their parents e.g. Ramsay Bolton or form their new cadet Dynasty e.g. Daemon Blackfyre.
If a bastard sires trueborn offspring without getting legitimized themselves, their Children are not considered bastards and do not have to carry the bastard surnames. They can choose their own name. E.g. Reniffer Longwater's ancestor.
"I see you wonder, what sort of name is that?" the man had cackled
when Jaime went to question him. "It is an old name, 'tis true. I am
not one to boast, but there is royal blood in my veins. I am descended
from a princess. My father told me the tale when I was a tad of a
lad." Longwaters had not been a tad of a lad for many a year, to judge
from his spotted head and the white hairs growing from his chin. "She
was the fairest treasure of the Maidenvault. Lord Oakenfist the great
admiral lost his heart to her, though he was married to another. She
gave their son the bastard name of 'Waters' in honor of his father,
and he grew to be a great knight, as did his own son, who put the
'Long' before the 'Waters' so men might know that he was not basely
born himself. So I have a little dragon in me."
AFFC - Jaime I