We have an hour a day rule. We also have to give 15, 10 and 5 minute warnings to the end of his time, otherwise he tries "but I can't save at this point etc etc".
It did used to be half an hour, but he doesn't watch television and his obsession with his Nintendo is his down-time that helps him to destress from school.
We have a set routine after school each day and he knows that he comes home, gets changed, has a drink and a snack, then does his homework and then had his Nintendo time.
He isn't allowed to have his hour until after lunch at weekends either.
We are also very selective about the games he is allowed to have. Fortunately he mainly likes the 'questing' type games rather than high action or fighting, but he has occasionally asked for games we think are unsuitable and we stick to our guns.
During holidays and weekends etc, or if we are going somewhere he thinks he will be bored, he saves up his Nintendo time to have then.
For playdates etc, the rules are exactly the same. He is only allowed to have an hour, but his friends are allowed to have some time on it as well and that's not included in his hour.
That said, he has lost his Nintendo time today for frankly appalling behaviour at bedtime last night. Fortunately, I am going to be out, so my poor old Mum will be the one who has to deal with the resultant strop and moaning. 