I have been studying Japanese for some time now and this is something that textbooks probably won't teach you (or maybe they do now). It will come to you over time. I know that's is not the best answer ever, but my reasoning is that over time you will see the same word many times and you will start to notice how often that word appears is Hiragana, katakana or Kanji.
Hiragana is the base alphabet can be used for all Japanese word.
Katakana, however, was created for foreign based words. It is uncommon for these foreign words to be written in Hiragana and I don't believe any kanji exist for them.
ex1. bread is パン(pan) in Japanese, but the origin of this word is Spanish/Latin
ex2. basketball is バスケットボール (basukettobooru) in Japanese and the origin is obviously America.
ex3. German is ドイツ(doitsu) in Japanese, but the origin of this word is Deutsch which is German for German.
Note: I sometime use katakana for Japanese people's name if I don't know the correct kanji (just to differentiate their name for regular text). Some Japanese people and tv shows will also use katakana in place of hiragana. I understand it, but can't exactly explain why. It is a kind of humor I guess.
Kanji is a borrowed alphabet from China. It is used to differentiate Japanese homonyms, ease reading (for Japanese people) and other historic reasons that I just don't know
ex. はし(hashi) has several different meanings such as bridge or chopsticks, but it can be distinguished by 橋=bridge or 箸=chopsticks
ex2. わたしはにほんごをべんきょうします。(I will study Japanese)
私は日本語を勉強します。This is shorter than the original and is much easier to read (if you already know the kanji).
I hope this make sense, but feel free to ask me questions if you are confused about certain parts.
Japanesepod,
Please correct me if there are not misleading information above. Thanks!