As a rule of thumb, up to about 10 feet (3 m) with a normal floor: the drain needs roughly 1/4 inch of fall per foot (the standard figure in US plumbing codes such as the IPC), and beyond ten feet the pipe drops below the floor cavity. Past that line you are choosing between a raised floor, a lowered ceiling below, or a macerator pump. Venting rules also tighten with distance, so the exact limit is a plumber question.

A 10 ft run at 1/4 inch per foot drops the pipe about 2.5 inches, which still fits inside a normal floor structure. Double the distance and the drain exits the bottom of the floor; that is the moment the project changes character. On a concrete slab the math is the same but the cutting is worse: see moving plumbing on a slab.
In the free bathroom planner you place the existing drain once; from then on every toilet position is checked against the distance line automatically, with the cost range alongside: what moving a toilet costs.
Too little slope and solids stay behind; too much and water outruns them, with the same result. Either way you have built a clog machine inside your floor. The 1/4 inch per foot band exists because it moves everything together.
It is a real option for a spot the gravity drain cannot reach: it grinds and pumps waste through a small line, even upward. The trade: noise, power dependence, maintenance, and local code limits. Good for a secondary bath, rarely first choice for the main one.
Real money: a long reroute runs toward $2,680 and beyond on a slab, while a toilet near the stack moves almost for free. The planner warns the moment your layout crosses the line, before a contractor has to.