Superfluidity in nuclear systems and neutron stars