There are several things you need to consider when reading Frankenstein which will help you understand the themes running through the novel with more clarity. First, one theme is that of abandonment. Mary Shelley's mother died shortly after giving birth to her. She learned about her famous mom, Mary Wollstonecraft Shelley, only through the works her mother wrote--most of them dealing with the rights of women. Victor also abandons the creature shortly after his birth, therefore setting into motion all the hard, cruel events in the creature's life outlined in the chapters written from his POV. Second, there is the theme of parent-child relationships and responsibility. Mary Shelley's definition of love as stated in the book is in a nutshell, "We are responsible for those we bring into the world and must treat them with unconditional love." Again, it's obvious that she has issues with feeling abandoned by her mother's death. Probably, although there is no real evidence that her father neglected her, Mary felt that something essential was missing from her life. Third, the book came from a dare. Mary, her husband, Percy Bysshe Shelley, and several others were in Switzerland one summer. They dared one another to "write a ghost story". Hers came to her as a result of the famous scientists of the time who often attended dinners at her father's home. Charles Darwin's theories among others were often discussed.
In addition to both of the excellent answers above, I think something that needs to be taken into account as an influence on Shelley's work is her adherence to the tenets fo Romanticism. Romanticism was "a reaction against the scientific rationalization of nature in art and literature. It stressed strong emotion as a source of aesthetic experience, placing new emphasis on such emotions as trepidation, horror, and the awe experienced in confronting the sublimity of untamed nature." As we see with Victor Frankenstein's monster, she does indeed confront horror, but more important are her beliefs that science cannot recreate the more subtle and sublime virtues of life.
As thakkar has said, the spark for this story was the challenge of telling a ghost story to Percy Shelly and Byron. Nothing in literature happens in a vaccuum, so it might be reasonable to suggest that events in Mary Shelley's life contributed in some way to the novel she eventually wrote. Certainly her friendship with the poets Bryon and Shelley influenced her. In addition to the challenge to tell a ghost story, the poets were also interested in the intellectual and scientific developments of their times. All three of them were reputed to have been interested in galvanism. It has also been suggested that Mary Shelley's personal life (she lost a child shortly after birth before she wrote the novel) may have also influenced the work.
As with any work of art, it is problematic to try to impose motivation on an author. We can talk about the political or scientific climate that she wrote from and we can even talk about biographical details of her life, but we can't necessarily say that any one event caused her to write the story. Lines of influence are also difficult to identify (unless you have evidence from a primary source like her journals or letters that suggests this).