Letting your kids stay home by their self

At what age do you think it's okay to let your kids stay home by their selves? I had to run to my friend's house today she lives less than two miles away from me... it was just me and my son today and he's 13 years old he didn't want to go with me he was too into his game I asked him if he would be okay by himself for like 5 minutes. I've never left him alone in the house before. He said yes. so I left but while I was gone my mother n law came to the house and realized my son was by himself. She called me a demanding to know where I was at . I told her I'm on my way home right now... she literally made me feel like a piece of shit mom... in my state there isn't legal age for child staying home by their self so it's completely up to the parents. I'm not making this a habit and she acts like I am this is literally one time and it was less than five minutes actually!!