You don't have an archive option available for spaces and groups, but you could apply the following.
In case of a space you can set the space permission for everyone to 'view'.
In case of a group you can configure it as public restricted and disable the content type discussion. (Kick-out any members)
Hereby only an admin will still be able to create content.
To make it visible for users you can add an identifier like '[Archived]' to the space or group name.