I've read that the rule is 1/4" per foot of drain line. From what I know, the rule is based on the height of the P-trap to where you tie in. What part of the P-trap do you measure from? How low can you tie into an existing pipe?
You're limited by the size of the materials you're using.
If you're using a 1 1/2" trap, there must be a vent within 6' of the trap weir. The overall length of the drain is also limited based on the pipe size (P3105.2).
So if you're using 2" PVC, the drain must be less than 8' long horizontally.