The 26-year-old has signed a four-year deal and will join the Premier League club on July 1 when his contract at Hannover expires.
Diouf, previously of Manchester United, scored 25 goals in the Bundesliga after leaving Old Trafford in 2012, and also has three goals in 18 games for his country.
He joins manager Mark Hughes’ side along with 21-year-old Slovakian defender Dionatan Teixeira, who has signed for an undisclosed fee.
Stoke chief executive Tony Scholes said: "It's no secret that Mame is someone we have been looking to bring to the club for some time.
"Mark has wanted to sign him since he took over as manager last year. We tried to get him last summer and made another attempt in January, so we're naturally delighted to have finally secured his services.
"He has been a tremendous success in Germany as his record underlines that. He is keen to return to England and make an impact in the Premier League. We're pleased to be able to give him the platform to hopefully achieve that ambition.”
Diouf made just five appearances for United after joining from Molde as a 21-year-old in 2009, and he was shipped out on loan to Blackburn Rovers, where he scored three times in 26 appearances in the 2011-12 season.
Teixeira, meanwhile, is a Brazilian-born centre-back recently called up to the Slovakia U21s. He had trials at both Reading and Stoke while with Slovakian side Banska Bystrica, before signing for Stoke.
The duo's arrival takes Stoke's summer signings to four following the arrivals of Phil Bardsley from Sunderland and free agent Steve Sidwell, who was released by Fulham.