That is not necessary and is a personal choice. A dying person will become unconscious, but that does not always mean they are completely unaware of their surroundings. It may bring you (and perhaps, them) some comfort to stay, if you'd like to.