In the course of creating models for your scenes in Blender, you may need to treat separate objects as a single one, or break the parts of a single object into their own distinct objects — for example, you may accidentally add a new primitive while you're still in Edit mode.
Of course, you can simply undo, tab into Object mode, and re-add your primitive, but why act like you made a mistake and go through all those extra steps?
There's another way. When you add a new primitive while in Edit mode, all the elements of your new primitive are selected, and nothing from your original object is selected. If only there were a command that would let you break this primitive away from this object and into an object of its own. Fortunately, there is. While in Edit mode, press P→Selection, and your new primitive is separated into its own object. You can also access this function in the 3D View's header menu (Mesh→Vertices→Separate→Selection).
Tab back into Object mode and select (right-click) your new object. Its origin is located in the same place as its original object's origin. To put the origin of your new object at its actual center, press Shift+Ctrl+Alt+C→Origin to Geometry or click Object→Transform→Origin to Geometry in the 3D View's header. This Origin to Geometry operation checks the size of your object and calculates where its true center is. Then Blender places the object's origin at that location.
You can also specify that the object's origin be placed wherever your 3D cursor is located by pressing Shift+Ctrl+Alt+C→Origin to 3D Cursor or clicking Object→Transform→Origin to 3D Cursor.
A third option is similar to Origin to Geometry, but it moves the object's content rather than the origin itself. Do this operation by clicking Object→Transform→Geometry to Origin (Shift+Ctrl+Alt+C→Geometry to Origin).
As expected, you can also join two objects of the same type into a single object. To do so, select multiple objects. In Object mode, you can use the Border Select or Lasso Select tools, or you can simply Shift+right-click objects to add them to your selection. The last object you select is considered your active object and is the object that the others join into. With your objects selected, join them by pressing Ctrl+J or clicking Object→Join from the 3D View's header.
You can join objects of the same type only. That is, you can join two mesh objects, but you can't join a mesh object with a curve object. Using parenting or groups may be more appropriate.