The League One side have been without a permanent boss since sacking Dave Robertson on 6 September.
Former Preston manager Westley, 47, has been without a job since leaving Stevenage in May, after losing in the League Two play-off semi-final.
He watched from the stands as Posh drew 1-1 with Walsall on Saturday, leaving them 18th in the league.
"I'm thrilled. This is a great opportunity, it's a great football club," said Westley.
"There's not too many other clubs in League One spending around £4m putting a squad together. £1.5m came off the bench on Saturday, so there's real strength and depth, and the opportunity to work with a talented squad at a place that knows how to win is fantastic for me.
Westley's most successful stint at a club was his second in charge of Stevenage, when he led them from the Conference into League One.
He left for a brief spell at Preston, and returned to Broadhall Way in March 2013, but could not prevent Boro being relegated from the third tier in 2013-14.
Westley replaces Robertson, who was dismissed after a run of three wins from 17 games in all competitions.
Westley flew out to the United States to meet Posh chairman Darragh MacAnthony, who said he did not judge him on an "his apparent obsession with fitness and physicality over style, flair and fast free-flowing football" from his time at Preston.
"I will never as chairman of this football club sit back and watch what could be described as hoof ball or direct and ugly, uninspiring football," MacAnthony said in a statement.
"So understand that Graham Westley is clear on his objectives, what I want and the job that needs to be done at our club and quickly."