The sacrament of Anointing of the Sick has as its purpose the conferral of a special grace on the Christian experiencing the difficulties inherent in the condition of grave illness or old age. The proper time for receiving this holy anointing has certainly arrived when the believer begins to be in danger of death because of illness or old age.
Each time a Christian is seriously ill, he may receive the Anointing of the Sick, and also when, after he has received it, the illness worsens. Only priests (presbyters and bishops) can give the sacrament of the Anointing of the Sick, using oil blessed by the bishop, or if necessary by the celebrating presbyter himself. CCC 1527-1530