Jainism has a similar history to Buddhism. Buddha was the first Buddhist to reach enlightenment, and Mahavira was the first Jain to reach enlightenment. Mahavira was born into a royal family in India. At the age of 30, Mahavira abandoned his current life and set out into the wilderness to practice meditation and personal sacrifices to reach enlightenment.
When Mahavira returned from the wilderness, and spent the next 30 years teaching the philosophy he learned through his penance (personal sacrifices). His goals were to elevate a person's quality of life through meditation and practicing his eight cardinal principles, three metaphysical principles, and 5 ethical principles.
Mahavira believed that pursuing personal pleasures was an endless game that one needed to remove himself from. He taught one needed to train their minds to curb individual interests and desires. In Jainism, similar to Buddhism's nirvana, is moksha. This is where one reaches complete liberation. The soul becomes its purest form and no longer needs the body. Mahavira attained this liberation in 527 BC.
Other historians of Jainism, believe that Mahavira was not the founder, and was the 24th and last tirthankara. Which means great religious teacher, a person who has conquered death and rebirth, and helps people reach liberation. To these other historians, Parsavanath was the founder of Janism, and was the 23rd tirthankara.
Around 300 BC, Jainism was split into two divisions. One side, Digambaras, claimed monks and believers should be accepting of nakedness. Schvetambaras, believed that monks should wear white robes. Digambaras believe that females can not obtain liberation, while Schvetambaras believe they can. Digambaras also believe that food is unnecessary once one obtains omniscient.
Today there are roughly 5 million followers of Jainism, mostly all in India. However, it is said that in the beginning of Jainism, it was more popular and growing faster than Buddhism. Eventually Jainism declined for a few reasons. It is believed that for common people, it was too hard to practice self sacrificing. The Hindu gods became more popular and people lost interest in Jainism.