To change the duration, grab and move the handle that is positioned on the right side of the time ruler. Move to the right to extend the duration and to the left to shrink.
Zooming on the timeline
You can zoom in and out on time periods to edit keys more precisely
Use the slider on the top of the ruler to zoom in and out.
Choose frames or seconds
You can switch the ruler to visualize the time from frames to seconds. The timeline will play the same no matter what you choose—It's just a matter of how the ruler visualizes the time. By default it shows the time in increments of 24 frames per second.
When you record the animations in real-time or edit, visualization in seconds might be more convenient.