As someone who has actually been involved with organ transplantation cases I can tell you how its done.
First of all, donors are brain dead people whose bodies are kept viable with ventilators and drugs. The donor transplant network is called and they come to do an evaluation. They will often do further tests to make sure that donor tissue is viable (I once was asked do do a liver biopsy at 11:00 at night, and the tissue was sent by car to a pathologist).
Once the donor network has determined which, if any organs, are to be donated, then the body will be taken to surgery. The anesthesiologist is there purely to make sure the patient keeps a blood pressure (as the body can feel no pain). The organs are harvested. The last organ to be harvested is the heart and lungs, as once those are harvested, there is no more blood flow.
The organs are placed in a specialized cooler and then flown by helicopter to the recipient hospital, where the recipients (who have been notified by pager) are waiting. They then undergo the transplant surgery.
In terms of how long the organs last, I honestly can’t tell you as I’m not involved with that side of it. Some last longer than others.