.pl is the standard Perl extension.
.pl just to indicate it’s written in Perl
.pl files are executed from a unix command line
.cgi is the standard extension for CGI executables
.cgi files are executed by a web server
Both could have the exact same code inside.
the cgi extention can really be anything, it all depends on the way the HTTP server was configured to run scripts(ScriptAlias)
cgi script file does not have to be just perl, it can be shell script, or C program