Basically, Blue means apple to apple and uses data. Green means it is using text and is used for messages between apple and apple and all other platforms like Windows and Android and Blackberry.
Blue = iMessage and counts against your data allowance.
Green = SMS/MMS and counts against your texting allowance.
iMessages can only be sent to Apple devices. Non-Apple devices cannot receive iMessages and therefore the message must be sent as an SMS/MMS. If you have a group message with 1 or more non-Apple addresses in the list of recipients, it will be sent as an SMS/MMS even to Apple devices.