To add to previous answers:
Fill in means to supply something that's missing. So you fill in the blanks on a test, for example, or you can fill in a triangle with a color (change it from an outline to a solid triangle by coloring inside it), or you can fill in (substitute) for an absent colleague at work. And you can fill in a form because you're supplying missing information.
Fill out means to complete by supplying requested information.
So you can
fill in Form 195B (I get a mental picture of a form with blanks to write numbers or small bits of data) or
fill it
out (could be either a form with blanks or one that asks for longer answers). Those mental pictures aren't the only possibilities, but you can see why both phrases work.
Fill up means to make full. You
fill up containers with liquid, for example, or you
fill up your stomach with junk food. If you
fill up a form, you've used all the available space on it and have to ask for another sheet of paper.