Bad news: different software has different methods of installing, and not all make it easy to choose where or how to install.
I always have a ~/Source directory where I clone projects and build them. Generally you see that well-structured projects have a separate
make install target, so you can compile the software as a regular user and then run
make install as root to install.
/usr/local is the default install prefix. It is common for software to refer to the
PREFIX environment variable for configuration and installation, so you can create your own local prefix (such as
~/.local, something you have write access to) and add it to your
PATH, then when compiling/installing software set
PREFIX to your local prefix in the environment. As @risk mentioned, configure scripts commonly take
--prefix with an argument as an option, too.
Sometimes you may have to manually edit a Makefile or install the compiled binaries by hand where you want them to go, but that’s a relatively rare occurrence.