Add something like that to ~/.kde/share/config/kdeglobals: (or change it accordingly if that group already exists)
Code:
[RecentDocuments]
UseRecent=true
MaxEntries=2
You have to change the value of MaxEntries to your preference of course.
With UseRecent=false you could disable it completely, UseRecent=true can be omitted since it's the default.
Or just use kwriteconfig to change it:
Code:
kwriteconfig --group RecentDocuments --key MaxEntries 15
To disable it:
Code:
kwriteconfig --group RecentDocuments --key UseRecent false
You may have to logout/login for the change to have effect.