The government of Saudi Arabia issues special visas for those making the pilgrimage. Most pilgrims opt to use a specialist travel agency, which will handle the considerable paperwork for them, but detailed information on the strict requirements is available at the Ministry of Hajj. As usual in Saudi Arabia, women must travel together with a male guardian (Mahram), unless they are over 45, travelling with a group and have their guardian's signed consent.
Visas are assigned to countries on a quota basis according to the number of Muslims they have. Recently, those who have previously been to Mecca have had additional restrictions placed on their entry, in an effort to discourage overcrowding while still accommodating those who have not yet made the pilgrimage. If the applicant was not born a Muslim, they must present a certificate testifying so, which has been notarized by an Islamic center. Usually your mosque will be able to arrange this or at least point the way.