Should be with .php extension.
Can be anywhere in public_html or a subdirectory ( if in public_html/scripts/test for example, the URL would be mysite.com/scripts/test/newfile.php [try not to use Capitals or special characters in file/directory names )