Manual:$wgCookieExpiration

Details
Default is 2592000 seconds, which is 30 days. This means MediaWiki users will be logged out automatically 30 days after they log in. Setting this to 0 makes all cookies session-only.