There is no legal age. It's all a question of risk. At the end of the day, you could leave a, say, 9 year old by itself for long periods and, provided nothing untoward happened, you'd be OK. OTOH, you could leave a 13 year old by itself for an hour or so and could be classed as negligent if something terrible happened.