What if i stays long (not doing any action) in the particular Component(Page) where i have used Scoped and Transient service object.
A request lasts from the point you hit enter in the url (or a link or button) until the page is loaded. After that, the request ends.
HTTP is stateless, it doesn't have any permanent connection or state. If a page takes 50 ms to load, after that the request ends and services get disposed. When you click a link, a new request starts with new dependencies instantiated.
Every request will always have a new instance, so don't "store" data in services that you need for next request. If you need stuff for next request only, use TempData and if it needs to persist more than until next time its accessed, use Sessions
Will the value be retained forever ? or will it dispose automatically after some time?
After end of the request, its not save to access the services anymore. Disposing releases all unmanaged resources (connection, file handles, unmanaged memory).
The object itself remains some (unspecified) time in memory until the garbage collection kicks in and frees the object and the memory. That assumes you are not holding any reference to the service after the request ends, since only objects that have no references can be garbage collected.
That's how managed runtimes work. Garbage collection is not deterministic, so it can happen at any time when the conditions to trigger it are happened.