There are several rough guidelines, but they tend come with lists of exceptions, many of which are common nouns. To begin with you may find it better just to learn them by rote, then perhaps look at some of the guidelines that you will find on the web to see how useful or not you think they are.
As an example, singular nouns ending -en tend to be feminine - but bachgen is one of the common exceptions. Multi-syllable -aeth nouns are nearly all feminine - but not gwasanaeth, gwahaniaeth and a few others.
A few nouns also change gender depending on dialect and region, some very locally - tafarn can sometimes be found as a masculine noun in mid-Glamorgan. A few nouns have different genders, and occasionally different plurals, for different meanings - llif, for example.