Heidfeld, 28, said that the deal represented "the fulfilment of a big dream".
The German carmaker is taking over Swiss-based Sauber from January 2006 and entering their own team after supplying Williams with engines since 2000. Heidfeld is their first signing.
"We are very pleased that Nick will be with us in what will undoubtedly be a difficult initial phase," said BMW motorsport director Mario Theissen.
"He is not simply a fast and courageous driver, he is also an analytical and meticulous worker. Nick already knows the two sites in Munich and Hinwil and is familiar with everybody involved."
There was no word in the statement about Canadian Jacques Villeneuve, the 1997 world champion who has a year to run on his Sauber contract which he expects to be carried over.
Heidfeld’s deal represents the culmination of a remarkable turnaround in the driver’s fortunes and reunites him with old friends after three years at Sauber from 2001 to 2003.
"I’m not expecting a miracle during the first season after a new start in 2006," said Heidfeld. "But I’m confident that the new team will be successful over the long term."