It's derived from the Hindi word "gymkhana", which itself comes from the Persian word "khanah", meaning "house" or "place". This was combined with the English word "gym", likely referring to the gymnastic skills involved in some of the events.
So, while the word is now used globally to describe equestrian events, it has its roots in India and reflects the history of the sport in that region.