CGI Scripts are just text files.. They may have different file extensions.. but they are still text files. You can use any text editor you want to edit them. My personal favorite is the shareware program Textpad ( http://www.textpad.com/ ).
They are usually writen in a language called Perl (although you can use just about any language you want.. perl is the most common). If you need more information on Perl, visit http://www.perl.com/