I was reading about the session expiration in this link and I want to know if I can set the session timeuot to 24 hours
Yes, the maximum time you can set is 24 hours. You can do this by going to Session Settings, found in Setup > Security Controls > Session Settings.
Length of time after which the system logs out inactive users. For Portal users, the timeout is between 10 minutes and 24 hours even though you can only set it as low as 15 minutes. Select a value between 15 minutes and 24 hours. Choose a shorter timeout period if your org has sensitive information and you want to enforce stricter security.