Messages sent to other iOS devices (like iPhones) using iMessage appear in blue, messages sent to non-iOS devices (or iOS devices not supporting iMessage) appear in green. In other words, the blue messages go through Apple's iMessage system and the green ones go through your carrier's messaging system.
Blue = iMessage
Green = non-iMessage
Currently, iMessage is only availble for iOS 5. So where you send text / photos / videos to someone who also has iOS 5 installed, the messages appear blue. Otherwise they are green.
This is very useful for knowing beforehand whether you'll be charged SMS/MMS fees, especially if you're messaging with someone in another country.
Learn more about iMessage here: