He spent like 17-19 years on it if I'm not mistaken. After the clone wars ended he travelled there to remain in hiding similar to the way Yoda went to Dagobah.
Well Solo takes place 10 years before A New Hope or 1 year before Obi-Wan. Which would be 5-6 years before his appearance in rebels. He told Qu’ira to meet him on Dathomir at the end of Solo. So it could be anywhere between 1-6/7 years. I doubt he’s been on there too long because he was running Crimson Dawn on Dathomir. Plus Malachor was a wasteland and almost inhabitable. He wouldn’t have been able to survive there for multiple years. This is why I’ve been clamoring for a Maul series. There is a 15-16 year gap between his final appearance in Clone Wars and his appearance in Rebels. Other than how cameo in Solo, we have no idea what he’s been doing all these years other than running Crimson Dawn