I have a macbook air. Does Icloud store documents indefinitely or am I risking losing them after some period of time?
If iCloud storage is always in limits it could be free 5GB or the next storage plan used Check your iCloud storage usage online or on any device - Apple Support , the iCloud Drive and desktops and documents box is always turned on Add your Desktop and Documents files to iCloud Drive - Apple Support
Use iCloud Drive to store documents on your Mac and iOS devices - Apple Support
And you never delete the documents and empty the trash Delete files and folders on Mac - Apple Support they will stay on iCloud Drive and iCloud.com forever .