Short answer: Blue ones have been sent or received using Apple's iMessage technology, while green ones are "traditional" text messages exchanged via Short Messaging Service, or SMS.