How to require a user to be logged in to access files
You have to setup the private file system. You can do this on /admin/config/media/file-system. 

Next you will have to alter your field to use the private file system instead of the public file system. If this field already has data, you can use https://www.drupal.org/project/filefield_paths to migrate the files from public to private