Her exit comes at a difficult time for Musk, who is dealing with falling sales at his electric vehicle maker Tesla and is embroiled in a war of words with US President Donald Trump.
Yaccarino did not give a specific reason for her decision. X and Yaccarino did not immediately respond to requests for comment.
She took the top job in 2023 to help Musk transform the company after he bought it in a US44-billion deal.
Prior to becoming the CEO of X, Yaccarino spent several years modernising the ad business of Comcasts NBCUniversal.
The social media platform is dealing with a heavy debt load, and Yaccarino has often had to deal with controversies stirred up by Musk, including his endorsement of antisemitic conspiracy theories in late 2023.