When an object is thrown vertically upward, its velocity decreases due to the acceleration due to gravity ($g$) acting downwards. At the maximum height, the velocity of the object momentarily becomes zero. We can use kinematic equations to find the time taken.