"Put my two cents in" originates from the older "put my two bits in" and has its origin in the game of poker. When playing poker you have to make a small bet before the cards are dealt called an "ante" to begin play in that hand.
This phrase draws an analogy to the poker ante (two bits) and gains your entry into the conversation.