As usual, Iyengar explains it best in the Tree of Yoga:
The first level of yoga consists of what can be called dos and don’ts. Niyama tells us what we should do for the good of the individual and society, and yama tells us what to avoid doing because it would be harmful to the individual and to society. These are ethical disciplines which have existed in the human race in all places from time immemorial. Yama and niyama are traditional whether in the civilisations of the East or the West, the North or the South.
The sages of old, who experienced the sight of the soul, discovered its seed in yoga. This seed has eight segments which as the tree grows give rise to the eight limbs of yoga.
The root of the tree is yama, which comprises the five principles of ahimsa (non-violence), satya (truthfulness), asteya (freedom from avarice), brahmacharya (control of sensual pleasure) and aparigraha (freedom from covetousness and possession beyond one’s needs).
Then comes the trunk, which is compared to the principles of niyama (Observances). These are sauch (cleanliness). santosha (contentment), tapas (effort), svadhyaya (self-study) and Isvara pranidhana (self surrender).
I have read literally dozens of slightly differing interpretations of these ethical precepts- the 10 commandments of yoga – and if you click on the tags for each of them you will find discussion relating to each of the yamas and niyamas. But here are a few quick notes that may give extra context to the brief descriptions above:
Asteya – above Iyengar says this is freedom from avarice. It is often translated as non-stealing.
Bramacharya – In the passage above Iyengar calls this “control of sensual pleasure,” but it is often translated as continence or sexual continence or even a celibacy. In particular, Gandhi wrote extensively about his own practice of brhamacharya, which he meant to mean complete celibacy. But as Iyengar points out in Light on Life, it cannot mean complete celibacy as so many of the primary sages of yoga were married and had children.
Aparigraha – Although I think the definition above covers it I think it’s useful to add that aparigraha includes moderation in consumption.
Svadhyaya – I have seen this interpreted to include study of yoga texts and spiritual texts. These can be considered self-study but it’s important to understand this does not mean solely introspective contemplation.
Isvara prahidhana or “Ishwar-Pranidhan” – often translated as “surrender to god.” In fact, “Isvar” or “Ishvar” means something like “God.” But in my own practice I have come to understand that for me, surrender to god and self-surrender — or surrender of the ego — are the same thing. More on that topic here.