The earliest recorded use of the phrase 'seven years' itch' was in Thoreau's Walden, published in 1854. That, however, had nothing to do with marriage particularly, but only to the passage of time generally. Here is the earliest quote regarding marriage and its tendency to become a bit stale and irritating after the early years...
"May you have the sevenyear itch," was answered, "I hope your wife eats crackers in bed." (Sandburg's People published in 1936.)
Clearly, then, it refers to how attitudes change towards habits that may oiriginally have been endearing but have now become just annoying. As suggested above, such changes in a marriage are quite likely to occur at the seven year stage.
(And what a marvellous film the Monroe/Ewell one referred to by J above was!)