Clustering in neutron-rich and stable nuclei