“Thousands” is only technically true. There are about 2000 in common, general use. 1000 more in common use for names, but from what I’ve seen of Japanese documents and applications most people ask for the phonetic version of your name along with the Kanji. So even a lot of Japanese people can’t easily read all the name characters in one go, much less write them. (Granted some of this is because the Kanji->reading mapping isn’t 1-1 or even wholly predictable)
It’s certainly not Chinese where estimates of how many characters you “need” vary wildly from 4k to 7k to one estimate I was told that seems a little high – 11k.
But generally speaking, I’d say you only really “know how to write” Japanese if you can reliably write about as well as a Japanese graduating high school senior is able to. Which generally means most of the 2000 Kanji, with maybe a few gaps for the less common ones.
This is, of course, ignoring issues of “true” fluency (sometimes things are arbitrarily written in Hiragana or Katakana for purely stylistic reasons, and recognizing when it’s appropriate to do so).