If there is an installer, the installer almost always store the app in the Applications directory.
- Some installers have a Windows-like install process, and they typically just put the app in the Applications directory.
- Some installers make you drag the app into the Applications directory icon in the installer.
- Some apps don't have installers. You need to drag them whereever you want to put them. If they wind-up on the desktop, it's becuase you put them there. Don't put the there. Put them in the Applications directory.
- Downloads should normally go to the Downloads directory. So, if the app doesn't have an installer, you would then move/copy the app to the Applications directory using Finder. But you have have your browser configured to put downloads on the desktop. A lot of people seem to do this, I've no idea why. Maybe they just like cluttered desktops.