How soon after a spinal cord injury is it okay to give the person a massage?

Depends . On the degree of injury, the mechanism of injury, and any concommitant complications or other injuries. Once the individual is stable, there are no blood clots, no open wounds, and no signs of any other injury or autonomic dysfunction the patients doctor can determine if it is safe. This can be within days, weeks or longer depending on the individual situation.
Soon. There is probably no problem with massage unless the area to be rubbed has been injured (cuts, broken bones, scrapes) or has had surgery. Check with the doctors caring for the person. Showing the person care and affection in this way (touch) can be very positive for a person experiencing a catastrophic injury.
See below. If the spine around the injury is stable, as in no fractures, then a light massage is probably okay if the patient can tolerate it. Deep massage, spinal manipulation is not a good idea at this stage.