Mostly, the programs, libraries or whatever you are installing will take care of "where to put" themselves, (as the programmers of that software or packages see fit).
If you've downloaded .deb files, you can simply use:
dpkg -i <packagename>
Everything is taken care of during the installation of the package.
If you've downloaded binaries in the form of tar.gz files, then all you would do is extract the content of the tar.gz file, then:
sudo make install
Unless you want to change something, everything is taken care of during install.
Otherwise, if you KNOW the NAME of the package, it's always easiest to do:
sudo apt-get install <package name>
And again everything is taken care of (including the downloading). All you need to do is make yourself a cup of tea.