The basic rule, which you probably know, is that there is a well-defined list of verbs that are followed by to-infinitive, like "want" and "need". All the others (including "hear") are followed by -ing.
e.g. I heard shouting in the distance but I don't know who was shouting.
With the verbs "hear" and "see", we can also add an object person that acts as the object of "hear" and the subject of the -ing (gerund)
e.g. I heard someone shouting in the distance.
In these sentences, the meaning is physical. My ears detected these noises. You would not reformulate them as sentences starting "I heard that...." This is because "I heard that" has a different meaning. It means "I heard some words that made me intellectually aware of some information." The examples of Teacher Jan and Mike relate to this sense of "hear".
At your level, you need to know all three verb structures that I've mentioned in this answer.