Ainsworth has been in caretaker charge at Adams Park since Gary Waddock was relieved of his duties at the end of September.
Although they remain in League Two's bottom three, level on points with the two teams below them, their form has improved under the former QPR favourite with impressive victories over Torquay and Fleetwood, and a run to the Johnstone's Paint Trophy area quarter-finals.
The 39-year-old has been given an initial contract until the end of the season and 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.
"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: "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."
The Chairboys have also confirmed that keeper Nikki Bull's request to leave the club has been granted.