Mary Shelley was 19 years old when she began writing Frankenstein in June 1816, and 20 when she completed it in 1817.
Context: During a rainy summer at Lake Geneva with Percy Shelley, Lord Byron, and John Polidori, the group held a ghost-story contest. Mary's nightmare-inspired tale became the foundation of the novel, published anonymously in 1818.