Minecraft wiki entry for Mushroom_farming, associated text: Mushrooms may theoretically spread up to five blocks away (including diagonally along all 3 axes), though only if the blocks in between are valid mushroom locations. Spreading this far has a very low probability - a majority of spreads will be within 2 blocks of the original mushroom, and the most common locations will be within one block of the original mushroom.
The algorithm is weighted in a way that favors spread to nearby y-levels. This further reduces the chance of a mushroom spreading far in the y direction.