Help me with SQL query - Calculate time difference for consecutive rows

Hi all, I have modified my query with Partition By, and it gave the correct results.
Thanks once again for your reply.