In 1900 in the Paris Olympics. This was a one off, and the sport returned in 1912. Also in the 1900 games the Olympics included show jumping, high jump and long jump competitions, and polo.
In 1908, only polo was held. (Sadly, polo has not returned to the games).
Until 1952, participation was limited to military officers and "gentlemen." In 1952, the competitions were opened to all men, and dressage to women (show jumping and eventing were presumably considered too "dangerous" for ladies). Ladies were allowed in show jumping in 1956 and in eventing in 1964.
The other event involving horse riding is the modern pentathlon, which was also introduced in 1912. (I'll talk more about that in another post).