Big O also describes memory usage. If you allocate an array of size n, space complexity is O(n). If you use a fixed number of variables, it is O(1).
Recursive algorithms use O(h) space for the call stack, where h is recursion depth. For balanced trees, h = log n. For linear recursion, h = n.
Space and time are often traded. Hash maps use O(n) space to achieve O(1) lookups.