For most countries, you can only enter a country without visa for a limited amount of time. In most cases this is 90 days (at least for citizens in developed countries) but sometimes it is only 30 days, or even 15 days.
In these countries, usually there are business or other visas available.
Can I apply for these visas just to travel for extended amount of time
I won't earn any salary from any person or organization within the country, although my job is sole-proprietor iOS Developer and thus I keep gaining revenue just as I do from anywhere in the world.
If more specific details are required, I assume the case of single Japanese people going into China, which lets you only 15 days of visa-free entry. I want to stay there for 30 days to up to 90 days. But I want to get more general answers, if possible.