No one knows with precision when Yoga began, but it certainly predates written history. Stone carvings depicting figures in Yoga positions have been found in archeological sites in the Indus Valley dating back 5,000 years or more. There is even evidence of some form of yoga in ancient Egypt.
In the second century B.C. or thereabouts, the ancient rishi Patanjali formalized Yoga into what is known as the Eightfold Path of Yoga. His writings are called the Yoga Sutras. This system consists of: yama (moral conduct), niyama (religious observances), asana (right posture), pranayama (control of the prana or subtle life currents), pratyahara (withdrawal of the senses from external objects), dharana (concentration on one thought), dhyana (meditation), and samadhi (superconscious experience).
Here are some resources for further study:
"A Short History of Yoga," by Georg Feuerstein
"Yoga, Brief History of an Idea," by David Gordon White
Yoga Journal’s "Yoga 101" – selection of informative articles
"The Original Teachings of Yoga," by Dr. David Frawley