This is often challenging for students at the beginning. Both words can be broken down into 4 categories of use, which together can make it a lot simpler to understand when these two different words that have similar meanings should be used. Often this useful trick to differentiating these two words is not taught in schools. The words also mean several different things in English including for, by, through, during, etc.
Por: 1) Travel and communication 2)Exchanges 3) Duration4)Motivation
Para:1)Destinations2)Recipients 3)Deadlines 4) Goals
Every time you need to use one of these words consider these categories and the word to use will become a lot clearer!