When you think about it, it is amazing how easy it is today to print on a sheet of paper, and how hard it is to print on cloth. Anyone can buy a laser printer or an inkjet printer for a couple hundred dollars and print on paper all day long at rates up to 10 sheets a minute. On the other hand, you would be really lucky to print one T-shirt every five minutes -- the machine is also going to cost a lot more, and you will have to do each one by hand!
In the traditional silk-screening approach, you start with a square wooden frame about the size of a T-shirt. Over this frame you tightly stretch a piece of sheer fabric (originally silk, now polyester). This is the screen. Over this sheer fabric you put a thin sheet of plastic into which you have cut holes where you want ink to appear on the T-shirt. You can either cut the holes with a scalpel (an arduous task), or you can use a liquid plastic coating that's sensitive to ultraviolet light and "cut" the holes with light.
Next, you place your T-shirt on a flat board and press the screen onto the fabric. By coating the screen with thick ink using a sponge, you cause the ink to flow through the screen onto the T-shirt. For multi-color designs, you do this multiple times, starting with the lightest color and moving up to the darkest.
The alternative is to use iron-on transfers. You typically find these in T-shirt shops at the beach and other tourist attractions. The shop may offer hundreds of designs, and iron the design you pick onto a T-shirt while you wait. The design is created with thin thermoplastic inks on a paper backing. By heating the design, you bond it to the fabric of the shirt.
These links will help you learn more: