Each of the nine constituent regions of the Seven Kingdoms have bastard surnames decreed by custom, not law. Bastards with a high-born parent are given these surnames to hold them apart from their fathers' houses. The parents may give a bastard a different surname if they wish, e.g. Tyrion Tanner. Bastards with no known relation to a noble house have no surname, like other smallfolk.
The surname a bastard received appears to be connected to the location the child is raised, though this is not a consistent rule. Because of this, bastards who are half-siblings might have different surnames. For example, King Robert I Baratheon's eldest bastard, born in the Vale, is called Mya Stone, while his bastard from the stormlands (fathered on a noblewoman from the Reach) is called Edric Storm. However, whilst Aegor Rivers was raised at Stone Hedge in the riverlands, his half-brother Brynden, was also called Rivers, despite having lived at least the first few years of his life with his mother at King's Landing