In D&D 5e, what is the AC of an inanimate object, in case someone wants to attack it? Does it depend on its size? Is it different depending on whether you are making a ranged or melee attack?
This information is currently not contained in the rules and is generally in the purview of the DMG (which was not released at the time of writing this answer, but this more recent answer addresses).
Until then, I would class most objects as having a DC of 5 or so (10 - 5 for a Dex of 0). Armored or particularly hard objects would have an AC equivalent to roughly their amount of armor, so somewhere between 10 and 18.
This information is now covered in the Dungeon Master's Guide and can be found on pages 246 and 247.
An object's AC is determined by its substance; things like cloth and paper on the low end of the spectrum (AC 11) with something like adamantine on the high end (AC 23).
The size of an object, as well as how resilient it is, is used to determine its Hit Points. A tiny, fragile object such as a stein would have only a couple of hit points, whereas a more resilient tiny object such as a lock might have a few more.
The numbers presented in the DMG are only meant to be used as a quick guideline though so you shouldn't feel that they are the be all, end all of object AC.