Yes, there is genuine theory and a fair amount of neuroscience behind this practice.
Affirmations in New Thought and New Age terminology refer primarily to the practice of positive thinking and self-empowerment—fostering a belief that “a positive mental attitude supported by affirmations will achieve success in anything.”[1] More specifically, an affirmation is a carefully formatted statement that should be repeated to one’s self and written down frequently. For affirmations to be effective, it is said that they need to be present tense, positive, personal and specific. (from wikipedia)