There is some speculation as to the origin of the idiom. The earliest reference to an analog of "two cents" appears in the lesson of the widow's mite in both the Gospel of Mark and the Gospel of Luke. In the story, several wealthy temple patrons donate large sums of money, but an extremely poor widow places just two small coins, i.e. her two cents, into the offering. Jesus finds greater favor with her than with the wealthy patrons, seeing that the widow gave all of her money to the church while the wealthy patrons had much money left over for themselves. Some believe that the phrase originates in betting card games, such as poker.
In these games, one must make a small bet, or ante, before beginning play. Thus, the phrase makes an analogy between entering the game and entering a conversation. However, there is no documentary evidence of this being the origin of the idiom, so it is merely speculation. Other likely origins are that "my two pennies worth" is derived from the much older 16th Century English expression, "a penny for your thoughts", possibly a sarcastic response to receiving more opinion than was wanted "I said a penny for your thoughts, but I got two pennies' worth".
There is also some belief that the idiom may have its origins in the early cost of postage in England, the "two penny post", where two pennies was the normal charge of sending a letter containing one's words and thoughts or feelings to someone. "Two cents" and its variations may also be used in place of the noun "opinion" or the verb phrase "state opinion". It makes a pun on the word "change". One meaning of change is an alteration presumably to bring someone or something in agreement with an expressed opinion. Another meaning of change is the cash equivalent of an overpayment. Thus the reference to two cents is in accord with another idiom that values opinions at one cent.