This depends on what procedures the child knows. (What to do if there is a fire, break in, etc.) It also depends how long the guardian will be away. If you feel the child is too young, I would consider a babysitter.
Mid teens. Where you can leave them by themselves if it is for a couple of hours were they can not do to much damage. But hopeful they know if they are able to stay home without supervision they might be able to do other things without having a babysitter when they get older they don't want a classmate looking after them. But at the end of the day it comes down to how much do you trust them in not doing the wrong thing. And have they earned that trust from you and if they have then it should not matter no younger then 12-13 someone might call the cops on for child endangerment.