Name change in Maine

Hello! I plan to change my legal name ASAP, and was wondering how long it actually takes from when you apply to when it actually changes? I have a trip coming up in 8 months or so and I want to make sure I can actually get a new passport so I'm allowed to travel.

Thanks!

Edit: why the downvotes? I have googled this question, but I know that on the practical side of things, paperwork or government things can take way longer than they say. I wanted to ask about people's experiences with changing their name. Why is that a bad thing?