To add to what Vrahjin said: The end of the cast bar usually, if not always, is the same time when the marker on the floor vanishes. If you are within the usually orange marker when it vanishes, you'll be hit by the attack, even if the animation and the damage come several seconds later. Conversly, as Vrahjin said, if you are outside of the marker when it vanishes, you'll not take any damage if you stand inside the animation when it happens.
In the past, long before heavensward was released, there were lag issues when you got hit by AoEs even though you were outside of them in time, or at least it looked like it for you. This was most notable in Titan Extreme, especially with the landslides which instantly killed you and you couldn't be resurrected anymore because you were dead on the floor far below the fighting platform. But this issue has been fixed since then and i haven't had it in years.