I don't know that there's any rule. As suggested in earlier posts, they should be only as long as they need to be.
I know that I have a tendency to make the cables longer than needed, so I try to keep an eye on my old catalogs and use them as a guide.
For instance, this shot of a Raleigh International is a typical example...
As far as whether the cables should be in front or behind the bar, I run them behind. Of course, my stems tend to be 100mm or so. With a much shorter stem, the smoothest routing might be in front of the bar.
Steve in Peoria