Microsoft has been in talks to invest billion into the owner of ChatGPT, the wildly popular app that has thrilled casual users and artificial-intelligence experts since its latest software was released last month, people familiar with the matter said.