Normally, you must pay on whatever money you have on your Zakah due date, whether you have had that for a few days or a few years. However, if you know that you will not have this money for a long time and it just temporarily came into your possession, then you do not have to pay Zakah on it.
Ali has $10,000 on the first of Ramadan. His children gift him $100,000. His Zakah due date is the fifth of Ramadan. He will have to pay Zakah on $110,000. This makes sense because he will most probably keep that $100,000 for a long time.
Ali has $10,000 on the first of Ramadan. His children gift him $100,000. His Zakah due date is the fifth of Ramadan. He plans to give this $100,000 in charity on the twentieth of Ramadan. Since this large amount of money only came into his possession temporarily, he will consider that amount as having a separate Zakah-cycle (hawl) and will not pay Zakah on it until an entire lunar year has passed. This is not the norm and should be used as an exception to the rule. (It is based on similar logic to a 1031 exchange in the US IRS code for properties)
Ali does not pay Zakah on the value of his personal home. He then sells his house for $1,000,000 on the first of Ramadan and moves in with his parents. His Zakah due date is the fifth of Ramadan. He plans to immediately use that money to purchase another house worth $700,000 but it may take him a month or two to find one. He can consider the $700,000 as having a separate Zakah-cycle (hawl) and will only pay Zakah on the $300,000 that will remain in cash form.
If possible, it is better to time transactions so they do not complicate your Zakah cycle.
Shaykh Mustafa Umar