iCloud & iCloud Photos · Storage Studio and iCloud
Do I need to be online for Storage Studio to free iCloud space?
Short answer: Files still waiting to upload stay on your Mac until iCloud has a safe copy, so you need a connection for those. Files already fully in iCloud can be freed straight away. Nothing is ever freed without a copy in iCloud.
Generally yes for files that haven't finished uploading. macOS only frees a file's local copy once iCloud has a safe copy of it, so files still waiting to upload stay on your Mac until you're back online.
Files that are already fully in iCloud can be freed without much traffic, since nothing new needs to be sent. Either way, Storage Studio never risks a file: if iCloud doesn't have it yet, it stays local.
Remember the other side too: once a file is online-only, opening it needs a connection. See opening online-only files offline.