The 23-year-old full-back as made 84 appearances for Latics since signing in 2012, scoring one goal.
Brown told the club website: “I’m delighted to have signed a new contract with the club.
“I’m looking forward to working with the new manager and hopefully we can make a push for promotion next season.”
Boss Darren Kelly added: “This is another great signing for the club in terms of going forward.
“I’ve heard good things about him on and off the pitch so I’m looking forward to working with him over the next two years.”