You should learn it by heart. When you learn a new word, learn it together with the stress - it should be pointed out in vocabularies. There are some patterns, but you will feel them later on, after learning more words. Memorization of any formal rule can hardly help.
Note that stresses are especially important in Russian. Wrong stresses would make your speech very difficult to understand.