In most facilities, meds can be given within a window of an hour before or after the scheduled time.
My instructors do a pretty good job of knowing who will need to give meds when, but I've had times when the instructor wasn't going to be able to get to me in time and I just asked the RN who was assigned to the patient to give the med (particularly on something like a pain medication).
I made sure to shadow the RN and observe the entire procedure, and when my instructor finally made it to me, I told her that I had asked the patient's RN to administer the med because it wasn't fair to make the patient suffer just because they had a student nurse assigned to them that day.
Then I also verbally "walked through" the procedure with my instructor, telling her that the med was obtained from the Pyxis, the drug and dose and expiration date was confirmed upon removal from the Pyxis, then upon entering the patient's room the name/DOB was confirmed, the ID band was scanned, the med was scanned, the pain prompts were completed (part of the eMAR at that facility involves telling where the pain is, what number on the scale it is, and what type of pain it is, etc.), and the medication was administered. I also say that I will perform a pain follow-up after 15 minutes (for IVP meds) or an hour (for PO meds), and that if this were in a situation where it would be applicable, I would explain to the patient that the pain medication could make them drowsy and affect their response time, so they should not drive or operate machinery while taking it, and also that they should not take any kind of sedative or drink alcohol while taking this medication.
This way, the instructor can see that I do know what to do, and that I was thinking of the best interests of my patient -- not just trying to get out of having to do something that I was supposed to do.