Canon law recognizes three levels of shrine. A diocesan shrine is approved by the local bishop; a national shrine needs the approval of the bishops' conference, which is why the Basilica of the National Shrine of the Immaculate Conception in Washington, D.C., carries that name; an international shrine requires the approval of the Holy See, as at Lourdes and Fátima. Canon 1234 adds the practical obligation: at shrines "the means of salvation are to be supplied more abundantly," especially through preaching, Mass, and confession. That is why the big shrines keep confessors on duty in many languages all day.
Basilica is an honorary title the Pope grants to a church for its history or importance, and it says nothing about pilgrimage on its own. Rome's four papal basilicas, St. Peter's, St. John Lateran, St. Mary Major, and St. Paul Outside the Walls, are both basilicas and pilgrimage churches. Many basilicas elsewhere receive few pilgrims.
Sanctuary (santuario in Italian and Spanish, sanctuaire in French) is simply the local word for shrine, so the Sanctuary of Lourdes and the Shrine of Lourdes are the same place. A cathedral is a bishop's church and may or may not be a pilgrimage site; Santiago de Compostela is both. The Holy Land is a special case: the sanctuaries there are cared for by the Franciscan Custody of the Holy Land, and the U.S. bishops' guidelines treat the whole region as a place of pilgrimage because of the Gospel events rather than any single approval.
Plan a pilgrimage