The word is by origin a diminutive of jock, the Northern English or Scots colloquial equivalent of the first name John, which is also used generically for "boy" or "fellow" (compare Jack, Dick), at least since 1529. A familiar instance of the use of the word as a name is in "Jockey of Norfolk" in Shakespeare's Richard III. v. 3, 304.
In the 16th and 17th centuries the word was applied to horse-dealers, postilions, itinerant minstrels and vagabonds, and thus frequently bore the meaning of a cunning trickster, a "sharp", whence the verb to jockey, "to outwit", or "to do" a person out of something. The current meaning of a person who rides a horse in races was first seen in 1670.
Another possible origin is the Gaelic word eachaidhe, a "horseman", (pronounced YACH-ee-yuh in late medieval times, with the ch pronounced as in German).
The Irish name Eochaid (YO-ked) is related to each (yek) "horse" and is usually translated as "horse rider". This is phonetically very similar to jockey.