Essentially, it depends on the war, who the winning side is, who the victim is, and who is wielding the sword
This answer contains content from A Feast for Crows
and A Dance With Dragons
; please do not read on, if you don't want to be spoiled.
A Game of Thrones
A Clash Of Kings
Jon snow yields to the Free Folk (to him known as 'Wildlings' at that time), which they accept (once Jon prooves his worth).
But when Ygritte yields to Jon earlier, Qhorin orders Jon to kill her.
In the melee of Ser Loras and Brienne at Renly's camp, Loras yields to her, and obviously is spared - since it's only a melee.
When Arya and co are beset by The Mountain and his men; Lommy yields, but to no avail since he gets killed anyway - this is because he is injured and is not worth the hassle.
A Storm of Swords
Jaime commands Lord Crakehall:
“Tell them the Mad King is dead,” he commanded. “Spare all those who yield and hold them captive,”
-A Song of Ice and Fire: A Storm of Swords, Part One - Steel and Snow, Jaime.
Tywin offers to let anyone who yields [their castle] to be spared:
"I mean to offer generous terms. Any castle that yields to us will be spared,"
-A Song of Ice and Fire: A Storm of Swords, Part Two - Blood and Gold, Tyrion.
Jaime later finds this out:
“Donnel was wounded in the battle and yielded to Ser Elwood Harte. He was ransomed afterward and pledged his fealty to King Joffrey, as did many other captives.”
-A Song of Ice and Fire: A Storm of Swords, Part Two - Blood and Gold, Jaime.
A Feast for Crows
- When Arianne and co are beset upon by Areo Hotah and his crew he offers them to yield, which they do and they are spared (except Arys)
“Yield, my princess,” the captain called, “else we must slay all but the child and yourself, by your father’s word.”
-A Song of Ice and Fire: A Feast for Crows, The Queeenmaker.
- Harras Harlaw spares two out of seven people who attacked him, because they yielded:
“The Knight took Grimston by himself. He planted his standard beneath the castle and defied the Grimms to face him. One did, and then another, and another. He slew them all... well, near enough, two yielded."
-A Song of Ice and Fire: A Feast for Crows, The Reaver.
- Jaime and his company come across a band of people hanged by the Brotherhood Without Banners:
“We came on some, the day before last,” said Jaime. Addam Marbrand’s scouts had found them, hanging black-faced beneath a crabapple tree. The corpses had been stripped naked, and each man had a crabapple shoved between his teeth. None bore any wounds; plainly, they had yielded.
-A Song of Ice and Fire: A Feast for Crows, Jaime.
A Dance With Dragons
- After the Free-Folks' siege against the wall, they are defeated and put into a stockade.
Later on, once they declare their fealty to Stannis, they are placed into hovels etc. in/around Mole's Town.
Follow the Rules
Additionally, a "yield" can be a source of revenue, given that the captor can be ransomed, to their family or overlord, for release. This is much more enticing to an attacker than straight-up killing them.
There is an air of expectation that you will be spared if you yield. Though not always followed-through by all.
Asha Greyjoy summarises this the best when she is contemplating her possibility to yield as urged by Lady Glover:
[A Dance With Dragons spoiler]:
... "give me back my children, and no harm need come to you. Nor to your men.”
The last part was a lie, Asha knew. She might be exchanged, perhaps, shipped back to the Iron Islands to her husband’s loving arms. Her cousins would be ransomed too, as would Tris Botley and a few more of her company, those whose kin had coin enough to buy them back. For the rest it would be the axe, the noose, or the Wall. Still, they have the right to choose.
-A Song of Ice and Fire: A Dance With Dragons, The Wayward Bride.