If you bet on a long shot, you get long odds. It's possible that this is where long odds came from. The OED first citations are: long odds from 17641; long shot with the meaning unlikely from 1796, but it's possible that the expression long shot was around earlier, but not written down.
And where did long shot come from? If you're shooting at something that's really far away, you are unlikely to hit it, so it's a "long shot". First OED citation for long shot meaning a distant target: 1767, but again it's possible that the expression was around earlier, but not written down.
And short odds are the opposite of long odds.
The phrase may have originally been nautical, which I suspect means it could have been around a long time before it appeared in print. From 1784:
He chose, in the seaman's phrase, a long-shot distance. The engagement began, and continued to the last, at too great a distance. 'Never,' said Sir Samuel,' was there ever more powder and shot thrown away in one day.'
1 ADDED IN EDIT: The OED has the following citation from 1764, but it's not clear to me that long odds has the usual meaning here:
Presently news was brought that the favourite horse, on whose head Mr. Huntly had laid the long odds,..had fallen and broke his leg, within three yards of the goal.
You don't generally put "long odds" on a favorite horse. The next OED citation is from 1818. The earliest "long odds" I can find in Google books is from 1783, which appears to have the modern meaning, and there are a number of appearances of "long odds" clearly having the modern meaning, starting around 1793.