How long did Abraham Lincoln know Mary Tod before they got married?

Mary todd had been courting Stephen Douglas prior to marrying Lincoln.