CGI files are not always text-based. They can be compiled applications. (eg written in 'C' or pascal then compiled into binary executables.).CGI files are text based
CGI files need not be in the CGI-BIN if you enable them in your httpd.conf.If you're asking where to save them on your site to execute, that would be the /cgi-bin directory.