Hi Nidhi,
Great idea! Rally has a Web Services API (WSAPI) which can be used for all types of automation like this. You can learn more about it at Access the Web Services API (WSAPI) | CA Agile Central Help For your account (or the account of the API user), you could set a WebHook Manage Webhooks | CA Agile Central Help to be notified when a change occurs. So, you could write code that is notified when a story is updated, sees if the time remaining is now zero, and if so it marks the story as completed.
You could also add a Custom List app to a dashboard Custom List | CA Agile Central Help with filters to look for un-completed stories with zero hours remaining. You could then do a bulk update to set them all to completed. This requires manual effort, but no coding.
If you'd like more details or have questions, just let me know! There's also Stack Overflow area if you have developer-centric questions if you build code to solve this Newest 'rally' Questions - Stack Overflow
-William