The Nov. 22 match pits Sampras, the former world No. 1 and 14-time Grand Slam winner who retired in 2002, against Federer, who has 12 Grand Slam titles including last weekend's U.S. Open.
The night match will be played in the 12,000-seat Malawati Stadium at Kuala Lumpur on a medium speed indoor carpet.
"Roger is a true class act. He is obviously a great player but his manners on and off the court set him apart just as much," Sampras said in a statement released by organizers.
Federer and Sampras have played only once before in an ATP match, when Federer won a five-set duel 7-6 (7), 5-7, 6-4, 6-7 (2), 7-5 in the round of 16 at Wimbledon in 2001.
"He is a true gentleman of the sport of tennis and I am very much looking forward to playing him in Kuala Lumpur. I have been preparing for the match very seriously and I will definitely be up to the task by then," Sampras said.
Federer said he and seven-time Wimbledon champion Sampras practiced together earlier this year at Sampras' home in Los Angeles.
"Although I will not get into who won the practice tiebreakers and sets we played, I will say that the tennis was of very high quality," he said.
The Federer-Sampras match is part of the events comprising the Malaysia Independence Tennis Festival. Another event is a challenge match between world No. 2 and three-time French Open champion Rafael Nadal on Nov. 20 against Wimbledon semifinalist Richard Gasquet of France.