Ada Lovelace married William King in 1835. The wedding took place on 8 July, when Ada was 19 and William was the 8th Baron King. After the marriage, she was known as Lady King.
The couple had three children: Byron, born in 1836; Anne Isabella, born in 1837; and Ralph Gordon, born in 1839. William King inherited the title of Viscount Ockham in 1838 and was created 1st Earl of Lovelace that same year. Ada then became the Countess of Lovelace, the title by which she is often remembered.
The year 1838 can therefore be a tempting mix-up: it was the year William received his higher titles, not the year of the marriage. Ada’s marriage also explains why historical sources may refer to her under several names, including Augusta Ada King, Lady King, and Ada Lovelace. Her most famous mathematical work with Charles Babbage came several years later, in the 1840s.