How to calculate capacity of a battery from the readings of current and time?
You have discovered why "battery capacity" is a vague term.  Yes, you have to define what the ending conditions are.  Usually this is the voltage that the battery should not be discharged below to avoid damage.

If you really want to know what the battery can do for you, it is better to measure the total energy delivered in one discharge.  That is the integral of voltage times current.  You can still measure capacity (integral of just current) to have something to compare to the official specs.