Yoga was first codified in the yoga sutra of Patanjali sometime between the 2nd and 4th centuries A.D. Traditionally the aim of yoga is ‘kaivalya’ or emancipation. Patanjali’s ashtanga yoga ( yoga of 8 ‘limbs’ or stages) includes asana (posture) and pranayama (breath control), as the 3rd and 4th stages.
In modern times asana and pranayama practices have been popularised on the basis of their benefits to health and general well-being. No particular religious affiliation is required in order to benefit from yoga practice.