We usually define the BQP complexity class to limit the number of gates, and hence the number of ancilla qubits, to be polynomial in the number of input qubits $n$ (which is also polynomial in the number of output qubits $m$).
The good news is that, for example, if $f$ was a (classical) Boolean function then for almost any reasonable problem you can think of (such as for a 3SAT problem), the number of added ancilla qubits would also be polynomial in the number of inputs. Otherwise your problem could be arbitrarily difficult.
For example, imagine your input register to be a matrix - such as an adjacency matrix of a small graph - and your oracle were to determine the permanent of the matrix. In this case there's no known simple way to describe the oracle with a polynomial number of gates, which I think also means that the number of ancilla qubits would likewise blow up. But, if you were determining the determinant of the graph then the number of gates and the number of ancilla qubits is polynomial as well.
Thinking some more, if your function $f$ is a permutation, then my intuition is that you may be able to get by with fewer ancilla qubits than if $f$ is not a permutation. My reasoning is that a permutation necessarily is reversible and hence you might not need to bring in extra ancilla qubits (especially if your gate set includes Fredkin/CSWAP gates). But I wouldn't know how to prove this yet.