In a statement, BC athletic director Martin Jarmond said Hafley was "someone we targeted from the outset."
He interviewed with Boston College this week and has been among the school's top targets since it began its search nearly two weeks ago.
Hafley, 40, is in his first season at Ohio State but has helped the defense dramatically improve. The New Jersey native spent the previous seven seasons with three NFL teams, including the past three as San Francisco 49ers defensive backs coach. He coached the secondary at both Rutgers and Pitt before entering the NFL.
"Jeff's shown throughout his coaching career he is a tremendous leader with high integrity and a gift for teaching," Jarmond said. "His passion, leadership and ability to recruit and develop student-athletes make him the right fit to lead Boston College to greater heights on and off the field."
Jarmond informed players of the hire after practice on Saturday morning.
"We're excited," defensive back Jason Maitre said. "Everybody is eager to get to know him. I can't wait to get to work."
Said defensive back Brandon Sebastian: "I'm really excited to get to meet the guy. It seems like he's a good coach. I'm just getting ready to go to work."
Hafley will be introduced at a news conference Monday.
He was a finalist for the Broyles Award, which goes to college football's top assistant coach. He worked with cornerback Jeff Okudah, a Thorpe Award finalist, and helped Ohio State rise to No. 2 in total defense a year after finishing 72nd. Ohio State will face Clemson on Dec. 28 in the College Football Playoff semifinal at the Fiesta Bowl and Hafley is expected to stay on with the Buckeyes through their CFP run.
Hafley replaces Steve Addazio, who was fired on Dec. 1, a day after the team finished the regular season at 6-6. Addazio, who went 44-44 in seven seasons at Boston College, on Thursday was introduced as Colorado State's head coach.
ESPN's Adam Rittenberg contributed to this report.