Where should I put static files in my extension that are just used in certain few pages?
Typically your extension directory would contain subdirectories named css and js and resources of those types would go in there.

To load them on-demand, use CRM_Core_Resources.