Great question! We have an 8yo and a 14yo. Our 8yo doesn't have a phone, but he does like to play Mine Craft on the computer. Our 14yo has a phone, but he doesn't like texting or talking on the phone, and he doesn't have internet access on it, so the phone isn't an issue at all. He does have an itouch, so we have limits for that. Here is what works for us.
Mostly we've worked on teaching values. We talk about the importance of being well-rounded and spending quality time with friends and family, not staring at a screen for hours on end. Both boys seem to get it. As for rules, we don't allow electronics at the table at any time, and that goes for adults, too. We are careful to practice what we preach. Also, we don't allow the boys to be on the computer/itouch/etc. for more than about an hour at a time. They know this, so they are pretty good about self-monitoring. We want them to do other things - go outside, read a book, interact with others.
The desktop computer is in a common area of the house, and all hand-held electronics are left in the kitchen at bedtime. No one takes any electronics into bedrooms at night. Bedtime is for sleeping, not playing on electronics. It has always been this way in our house, so no one has a problem with it.