In a letter to employees, Mr Mayer said his decision came after the “political environment has sharply changed”.
His resignation comes after US President Donald Trump ordered a ban on TikTok unless parent company ByteDance sold its US operations to an American company within 90 days.
“I have done significant reflection on what the corporate structural changes will require, and what it means for the global role I signed up for,” Mr Mayer said in the letter.
“Against this backdrop, and as we expect to reach a resolution very soon, it is with a heavy heart that I wanted to let you all know that I have decided to leave the company.”
Mr Mayer, a former Disney executive, joined TikTok as chief executive in May.
TikTok said it respected Mr Mayer’s decision.
“We appreciate that the political dynamics of the last few months have significantly changed what the scope of Kevin’s role would be going forward, and fully respect his decision,” the company said in a statement.
“We thank him for his time at the company and wish him well.”
Earlier this month, Mr Trump ordered a sweeping but unspecified ban on dealings with the Chinese owners of consumer apps TikTok and WeChat as the US heightens scrutiny of Chinese technology companies, citing concerns they may pose a threat to national security.
ByteDance is currently in talks with Microsoft for the US firm to buy TikTok’s US operations.