This example assumes that you're importing images during a posts import and you want to assign the images to the "Products" folder in the Media Library. You can modify the code to assign them to different folders or even dynamic folders.
Plugin and hooks used: