Answered by Faraz Rabbani
Question: If you are not sure you have said salam on one side – either right or left – is your prayer valid, or is it necessary (wajib) to say salam on both sides?
Answer: In the Name of Allah, the Benevolent, the Merciful.
Walaikum assalam wa rahmatullahi wa barakatuh
Giving both salams is necessary (wajib). [Shurunbulali, Maraqi al-Falah] Turning the head (to the right for the first salam and to the left for the second) is sunna. [ibid] When in doubt, assume that you gave both salams, and ignore doubts.
And Allah alone gives success