Ainsworth has been in caretaker charge since the club relieved Gary Waddock of his duties at the end of September.
The 39-year-old has overseen a first home win of the season against Torquay United, progress to the Johnstone’s Paint Trophy area quarter-finals with a magnificent 3-1 over League 1 Portsmouth and an impressive 1-0 win over promotion-chasing Fleetwood Town.
Ainsworth has been awarded a contract initially until the end of the season.
Joint-chairman Don Woodward said: “We knew he would be a front-runner for the job from the moment we placed him in caretaker charge, but his outstanding attributes really came to the fore over the last seven weeks and we feel now is the right time to seal our commitment towards him as the next manager of this proud football club.
“Gareth has had to contend with a terribly unlucky injury list but has got the players working hard for each other, showing faith in some extremely talented younger players and reaping the benefits with some impressive results since taking charge.
“His professionalism, enthusiasm and tactical awareness have impressed everybody on the board and we are all looking forward to working closely with him to deliver success on and off the pitch. Many things will change with him at the helm, and you will see a stronger and fitter team emerge and challenge in every game they play.”
Ainsworth said: “I’m delighted and honoured to be the manager of Wycombe Wanderers. The club has a big history of successful managers and I will be giving it my all to join that list.
“I would like to thank Don Woodward and the board for this opportunity. They’ve put their faith in me and I will work as hard as I possibly can to get out of this current situation, with the long-term aim to bring success to the club.
“I also want to thank Dobbo (Richard Dobson) and Lee (Harrison) for being with me every step of the way. They’ve been a huge help and I feel the three of us work extremely well as a team.
“The way the players and fans have responded to me in these seven weeks has been magnificent and if we carry on in the same vein, it can only be good for Wycombe Wanderers.”
Ainsworth joined the club on an 18-month contract in February 2010 following a successful loan spell from Queens Park Rangers, where he had spent seven years at Championship and League 1 level.
Formerly of Preston North End, Port Vale and Wimbledon, Ainsworth has made over 580 professional appearances and signed a one-year player/coach deal with Wycombe in the summer.