In a nutshell, the number of qubits in the top register directly corresponds to the number of bits of precision to which $x/T$ approximates $s/r$, and we need enough precision to be able to determine $s$ and $r$ given $x/T$. For example, if $s=1$ and $r$ is large, then we cannot afford to confuse $1/r$ with $1/(r+1)$, say.
In more detail, think about any ...
Maybe this paper can help you, that's what the implementation in Qiskit is based on.
Otherwise looking at the implementation of Shor's algorithm in Qiskit itself might be insightful. The circuit for the algorithm is constructed in the method construct_circuit and can be visualized with this snippet.
from qiskit.aqua.algorithms import Shor
a, N = 2, 3