It is only possible to set the maximum of SharePoint online document library version limit to 25. The minimum of version limit is always 0. In this situation, the version number is from 0 to 25.
Here are two ways to set version limit.
1.Go to the document library -> Library settings -> Versioning settings -> Document Version History -> Set limit.
2.Use PowerShell.
$SiteURL = "https://tenant.sharepoint.com/sites/emilytestnew"
$LibraryName = "Documents"
#Connect to SharePoint Online site
Connect-PnPOnline $SiteURL -Interactive
#Get the Library
$Library = Get-PnPList -Identity $LibraryName
#Set Version History Limit
Set-PnPList -Identity $Library -MajorVersions 25
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.