Find all files with the extension .jpg in the current directory and up to 3 levels of subdirectories and change the permissions to 664 for each of them.
find -maxdepth 3 -name "*.jpg" -exec chmod 664 {} \;