A headset is the name for the two set of bearings in the head tube on the front of the bike frame allowing the forks to turn freely. The bearings are enclosed in pre-fabricated cages with one sitting between the top of the fork and the bottom of the head tube and the other at the top of the head tube below the handlebar stem.
There are two types of headset; threaded and ahead.
Threaded is the older style where the top bearings cup screws on to the top of the fork steerer and the handlebar stem (quill type) is inserted into the fork steerer.
Ahead is where the top bearings cup sits around the fork steerer and the handlebar stem is clamped around the fork steerer and tightens down onto the top cap of the headset to keep them in place. External aheadsets have the bearing cups sitting outside the frame whereas internal or integrated are inserted into the frame to give a lower stack height but can only be used with compatible frames.
Headsets for road bikes tend to be 1 & 1/8 inch but newer frames are going to 1 & ¼ or even 1 & ½ for the lower cup so make sure you check your current setup before replacing.