Bill Gates and Mayor Michael R. Bloomberg announced on Wednesday that they will spend $500 million to stop people around the world from smoking.