"They hear a horse."
Translation:One słyszą konia.
First of all, 'koń' is the direct object of this sentence, so you need (usually) the accusative case.
For masculine animate (i.e. describing living things) nouns, the accusative is the same as genitive. Genitive for masculine animate and neuter nouns ends with '-a', hence 'konia' (ń becomes ni because you can't have ń in front of a vowel).
This is the comment from the user mihxal, which linked to a website that used to be great but recently became malicious, that is why I had to remove the comment so the link isn't there anymore:
In Polish there are three types of nouns which are called "gender": masculine, feminine and neuter. "Animate" means just "living" so masculine animate nouns name people and animals. Accusative and Genitive are cases. You can read more about them for example here: https://en.wikibooks.org/wiki/Polish/Noun_cases
Here you can find a simplified chart of declension: https://i.imgur.com/NjFhVJV.jpg