From the Basic Rules section on Concentration:
Some spells require you to maintain concentration in order to keep their magic active. If you lose concentration, such a spell ends.
If a spell must be maintained with concentration, that fact appears in its Duration entry, and the spell specifies how long you can concentrate on it. You can end concentration at any time (no action required).
The rule is very short and only says "at any time (no action required)". How is this "any time" is defined?
An example scenario:
I cast levitate on an enemy to remove them from the battle. Later at, on his turn, it turns out that he bringsraises a crossbow. The DM declares the attack, but then I interrupt him and say that I end my concentration, so he will fall down and become prone.
Another example scenario:
I cast levitate on myself and fly 30 ft. The enemy then flies and spends all his movement to fly to me, to attack me in melee. After he reaches me, I declare I am ending my concentration, so I can fall back to the ground, preventing him to attackfrom attacking me.
Is this allowed? Can I end concentration conveniently any time, interrupting any currently declared action/event?