Yes, there is: it’s determined by the binyan (construction) of the verb.
There are seven binyanim, each with its characteristic pattern of vowels. Their names reflect the vowel pattern in the past tense (3rd person singular, masculine)—thus:
The appropriate binyan of a verb is determined by whether it is a simple verb, or one that refers to an action to or on something else; or a manipulation of an object or a person; or a continuous or repeating operation—or the passive corollary of any the above. (For more information on that, see my post on How do I know if a verb in hebrew is pa’al type, pi’el type, or other?)
The short answer is that you fairly quickly develop an intuitive sense, from hearing (or reading) how other people use that verb. But if you’re looking for a broad rule of thumb to get you going, here it is:
There are many rules and exceptions on this point, which are founded on the notion that language rules can be formulated, like mathematics, on simple “If X, then Y” principles that always apply—such as, “If it ends with ah, then it must be feminine.”
But language is not like mathematics: the real determiner of any aspect of it (in any language) is what sounds right to native speakers and to anyone with an “ear” for the language. For example, the Hebrew word lailah (“night”) is masculine because lailah tov (“good night”) sounds OK, whereas lailah tovah sounds odd—and the reason for that is probably because all day-related terms, such as boqer (morning), yom (day), erev (evening) and even shavua (week) are masculine. So there is logic, but it is more subtle than a simplistic “If X, then Y.”