Warning - this is house rules territory
It's a long post and provides useful guidance, but if you are hoping for RAW (or even RAI) this ain't it. This is simply additional guidance on how to determine when an accumulation of molecules goes from being labelled as one object or many, as well as an interpretation of the shrink/enlarge spell that eschews the distinction between object and creature as well as one object or many. Useful for DM adjudication, but only loosely an answer to the question as asked. I'm posting it because I think it is useful to the community, but I'll understand if it gets down-voted for being off-topic (I don't think it is, but I can see both sides of this).
DM Guidance
To add to the other answers, a possible rule of thumb would be to ask if the collection of objects could be broken up without tools and/or significant amounts of time or effort. Furthermore, the guidance in the DM's Guide that objects Huge or larger should also be considered. However, for play-ability, I'd say that the magic of the spell works with the caster to define an object more or less as the caster would expect for his/her purposes.
A sword and hilt should be counted as a singular item as the sword is smaller than huge and separating them requires quite a bit of work (and/or tools). However, if the caster wanted to target only the blade, the magic would accommodate his/her will and treat them as multiple objects so that it could affect the blade but not the hilt.
A jar with a lid would be two objects as separating them is simple. However, if the caster wants to shrink or enlarge the jar and lid (and they are currently together), the magic would consider the jar one item and shrink them. If the jar and lid were separated when the spell was cast, they would quite clearly be two items, regardless of what the caster wished. If the jar and lid were later separated, the effect would remain with them both, so one would not suddenly return to normal size upon separation. This could possibly be exploited, allowing a single spell to be used on multiple targets by combining them before casting, but this is no more an issue than anything else that requires a DM call. I offer a way to handle this later.
A door is one item unless the caster wishes to treat it as multiple items by specifically targeting the knob or barred window embedded in it.
A carriage is multiple items because, per the DMG guidance, it is Huge or larger. The caster can try to treat it as a single item, but it is simply too large for the magic to affect at once and the spell would fail if attempted (even though a Gargantuan creature is well within the spell's capabilities, which seems weirdly inconsistent).
A small gnomish clockwork is also one object if the caster wishes (this goes against the DMG guidance, but is more logically consistent with the "because magic" interpretation), or many smaller objects if they so wish. This seems a broken interpretation, but...
A person and all of his belongings is a single target. This is specifically called out in the spell. The spell treats creatures differently than normal objects, but it might be a good idea to treat them the same, in which case...
A rules tweak
Definitely house rule, but the most consistent and specific I can think of while remaining simple and only minimally broken (no more than the spell is by default if not properly adjudicated).
The spell can affect any number of items so long as they meet the following conditions:
- They all fit within a (max) 10' cube (Large or smaller). This cube can be of any smaller size that the caster wishes, specified at the time of casting.
- They are all touching each other. This contact doesn't have to be direct - object A and C can both be affected so long as they are both touching object B. Object D and E would also be affected if object D was in contact with A and E was in contact with C, and so on (chaining).
- The spell is cast on a point in the dead center of the cube.
- The ground - or anything extending outside the area affected by the spell - is not affected.
- Likewise, any objects "connected" only through an unaffected object are not affected. So you could target a single creature even if it was adjacent to another creature if their only contact chain was the ground.
This allows for some rather different uses of the spell. For instance, a group of 4 medium sized creatures could all hold hands and be affected by a single casting. However, here's the rub:
If anything breaks contact with the point targeted by the caster, it is no longer affected by the spell and immediately returns to its original size. This is just like the way the RAW spell behaves in regards to creatures and their carried items.
So the group of four in our example would have to remain holding hands for the entirety of the spell (or they could have tied themselves together with rope prior to the spell's casting), imposing significant restrictions on the spell when used in this fashion.
This in effect treats an automaton full of gears and such the same as a human full of guts and bones. It treats a cart full of oranges the same as a horse loaded down with party gear (a valid target for the spell as per RAW).
The contact doesn't have to remain the exact same - the characters in our example can switch hands, so long as at least one unbroken link is maintained between each affected part and the targeted point.
Another consequence of this is that if an object is forcefully sundered, the part of that object no longer in contact with the targeted point immediately returns to normal size.
Re-establishing contact does not allow the spell to resume affect. Just like in the RAW version of the spell with affected creature carried items, once the item returns to normal size, another casting of the spell is required to change its size again.
But how do I target just the door knob? Easy - the caster can reduce the affected area of the spell when casting - the 10' cube is simply the maximum area that can be affected, but the affected area could certainly be a 1" cube if all you wish to enlarge is a ring. Or a 1' cube if all you want to affect is the knob - since the door would extend beyond the affected area, it would not be subject to the spell's effects even though part of the door is in the area of the spell.
This interpretation prevents the spell from affecting a creature larger than Large, which the RAW spell can do, so the 10' cube rule might need some adjustment if the DM feels that affecting such creatures is necessary (perhaps with some player prodding).
This interpretation largely allows the spell to function in a way that is similar to how it is commonly portrayed in media - movies and TV and books (comic and otherwise). The mage that points his wand at a stack of luggage and shrinks it down to portable size. The Ant-Man shrinking both car and passengers. The prankster causing a victim's toupee to shrink to the size of a dime. The spell's limit of only allowing the target to grow or shrink by a single category makes it less versatile than many of these portrayals, and the mechanics might make it less powerful than some of the extremes seen in a comic book (still looking at you, Ant-Man), but it makes it flexible enough to allow a group of adventurers to all sneak through a small opening by holding hands or to make a chest and its contents more portable without making it completely broken.
Is it perfect? Unlikely, but I think it provides consistent guidance that a GM could use to adjudicate edge cases for the spell without taking away significant player agency. And the DM is always allowed to intervene if it still manages to get out of hand.