Object's pivot consists of a point and a pair of vectors, they define how the object will be oriented when you position it using the build tool. The green arrow defines the object's "up" direction.
There are two ways to setup an object's pivot:
It is done automatically when you take or clone the object to the inventory. The pivot is automatically generated based on your position and orientation relative to the object. If you want a preview, hover the cursor over the object with the build tool selected.
There's an option in Main menu / Game settings called Pivot generation method that switches the pivot generation algorithm.
You can specify the pivot manually. With the build tool activated press
MMBand holding it specify the direction of the blue vector. The green one will be defined by the normal to the surface at the point where you've pressed the button.
When you release
MMB, the object will be automatically taken to your inventory.
Notice, that if you are already in a process of building (when the object is highlighted in green) you can also use
MMBto change the object's pivot.