Basically, when you land in Japan, you get a "landing permit" sticker in your passport which allows you to stay for a fixed duration, usually one year. The visa then becomes irrelevant. If you leave the country, the landing permit expires, meaning you need a new visa in order to come back -- UNLESS you have gone to the Immigration Bureau and obtained a re-entry permit, a separate sticker which costs a few thousand yen.
I second the idea to get tax advice if you are moving back and forth a lot.