Depends on the application. Generally, source code that you download comes with a README file that describes the build process. Usually it is as simple as executing the following three terminal commands
./configure
make
sudo make install
from the source directory. Some apps may also require source code or makefile modifications to work with Darwin/OS X.
Note: I've edited this with Lethe's corrections. Thanks! I was typing faster than I was thinking.