Felting (also called "fulling") is an after process. It is what you can do to a finished piece. You can only felt wool and it's entirely optional whether you felt or not after your piece is completed. Usually patterns that are felted after the knitting part is complete are written a bit differently, as the piece will shrink drastically after the felting process (in other words the pattern will call for you to knit something bigger than what the finished, felted piece will be).
There's a great article about felting on Knitty