Documentation is communication between you and any other provider who reviews your documentation. So, if the documentation is not in place you are not communicating. Standard practice is to document as soon as you finish the task you were performing. Realistically, shifts are super busy to the point that the first time a nurse is able to document is when the shift is over and another nurse has assumed care of that nurse's patients. If that is the case, the best you can do is to document then.
The exception to waiting till the end of the shift to document is the Medication Administration Record (MAR). Documentation of medication administration occurs immediately AFTER the medication is given. There is no waiting and also you do NOT document before administering the medication. Actually, all documentation is to be done after the task is completed and never before. I like to say "There is no Fixing-To documentation."
Some nurses have the mistaken belief that they can leave the hospital and then document when they come back for their next shift and that is untrue and a habit that if caught will result in disciplinary action by the Texas Board of Nursing/BON. Think about what documentation is used for; it is used to communicate to others when you are not present to tell them in person. So, if you are gone and the documentation is missing then no communication is happening and patient care is impacted.
The best practice is to do the task then document. You are also likely to remember more important facts if you document timely. So, not only is it nursing standard, best for patient care, but is also more likely to protect you and give you documentation you can rely upon in case something comes up later.