It depends. If the folder is owned by someone else and all files in the folder are owned by someone else, then the folder does not consume any of your storage space. However, you may own some files in a shared folder, and someone else may own some. In this case, Google only counts the files that you own against your storage usage.