It obviously depends but in general I do it like in reality - have a lot of seperated parts to gain a lot of flexibility. Animating and texturing is harder (that means, it consumes more time in general) that way (trust me, it really sucks to apply materials to hundreds of objects…) as you need to keep control over a lot of meshes and parts but usually it works out well. At least for modelling it, I’d advise to keep parts small. Needless to mention that you can often reuse these parts since machinery often makes use of a lot of identical parts, too.
Just keep in mind that TOO much isn’t very wise either. I ran into that problem quite often already…you need to develop a certain understanding of which kind of parts need to be seperated to keep it flexible, and which ones you can join to get at least a minimal amount of organisation into the model’s structure (again, trust me, parenting is extremely useful for that, as is instancing, but in some cases it is better to have actually only one object to work with, rather than to keep an eye on all of the child objects as well. Also, that way it is less likely to make mistakes - sometimes I simply forget about the parentship and then weird things start to happen, when I override the relationship and stuff…).
Obviously I’d also spend some time on planning the mesh…mechanical things can be a pain if you don’t look at how the details work first…
Last thing - that is how I go about mechanical stuff. However, I’m sure there’s a better way out there