hi there! good for you for wanting to start getting into shape!
i am assuming that you mean you would want to comfortably run the entire race, so in that case, i would say anywhere from 3-6 months. if you wanted to just finish, running some and walking some, i would say more like 6 weeks would be reasonable.
personally, it took me about 6 months to be able to run the entire thing. i know a lot of people say great things about the c25k program, but personally just kind of ran as much as i could, walked a little, ran some more, etc, until i built up my endurance to 3.1 miles.
i hope that helps you out, and if you ever need anything, don’t hesitate to ask! :)