What is the expiration time for refresh token?

Refresh Tokens expire after six months. Access Tokens expire after 24 hours.

You can keep your ATs fresh with a cron job run every 23 hours, or you can make a call with the AT, and if it fails, refresh it at that time using the RT. This latter course is simpler, but adds a delay to the first call made for a given user each day.

You should have a cron job that updates all Refresh Tokens once a week, so that in the case that a user doesn’t log in to your application for an extended period of time you won’t have to re-walk the autorization process.