Resources should be automatically deleted after 48 hours, if they are no longer associated with any notes. But there's a bug open at gh that mentions that orphaned resources are not automatically deleted. Unfortunately this haan't been fixed yet.
So sometimes they seem to be deleted and sometimes they are not.
Not really, but you could use the script jnrmor
from
Please backup your .config/joplin-desktop
folder, just in case!