In PHP I know that having many queries and variables slows the site down, but what about CSS and javascript? Is it a good idea to have many CSS and .js files? Does the browser have to download them each time it loads a page or do they stay in the memory? I need to know this so I'll know if I'll put more JS in my script or not...
Put JS and CSS in separate files, because they get cached the first time and won't needed to be downloaded again, and it also makes your main pages code look cleaner.
JS and CSS files are cached by the browser. The browser does not download the files on each request. Moreover, the size of these files is too small to worry about speed or optimization.