Here is a perfect article for you on patching it, http://www.ehow.com/how_8736421_repair-pajamas.html
It's pretty easy although you will have the string visible outside your pajamas. All you need is a sewing needle and some string. The article explains it better.
If it is at the torn seam, click here: http://www.wikihow.com/Mend-a-Torn-Seam
and here is repairing holes in middle of clothing.
Nice job Snivy. You are a good help on this site. I used to mend some of my clothes when I was a kid, both with a needle and thread. My 93 year old mother-in-law is very good with a sewing machine, so she sews and mends stuff for my wife and I. I wonder what she'd think if I gave her my footie jammies?