President Donald Trump said he would shut down TikTok in the U.S. by mid-September unless its local operations are sold to Microsoft Corp. or another domestic bidder, later adding that a “substantial portion” of the sale price would need to be paid to the U.S. government.