As the name implies, one part of the bond involves a hydrogen atom. This hydrogen must be attached to a strongly electronegative heteroatom, such as oxygen or nitrogen, the hydrogen-bond donor. The other half of the bond is another such heteroatom (N or O), called the hydrogen-bond acceptor. This has a lone pair of electrons with which the positive hydrogen can interact.
Generally speaking, the donor is that atom to which, in the absence of the hydrogen bond, the attachment of the hydrogen atom would not increase the positive formal charge on the molecule, whereas attaching the hydrogen to the acceptor atom would leave that portion of the molecule with a positive formal charge (dipole).
The most ubiquitous, and perhaps simplest, example of a hydrogen bond is found in the interaction among water molecules. In a discrete water molecule, water has two hydrogen atoms and one oxygen atom. Two molecules of water can form a hydrogen bond between them. The oxygen of one water molecule has two lone pairs of electrons, each of which can form a hydrogen bond with hydrogens on two further water molecules. This can repeat so every water molecule is H-bonded with four other molecules (two through its 2-lone pairs, and two through its 2 hydrogen atoms.)
Hydrogen bonds are very strong manifestations of a dipole-dipole attraction. Although they are strong, they are still generally weaker than both ionic and covalent bonds.
Liquid water's high boiling point is credited to the high ratio of number of H-bonds each molecule can have compared to it's low molecular mass. Water is unique because its oxygen atom has 2-lone pairs and 2-hydrogen atoms, meaning that the total number of bonds of a water molecule is 4. Compared to hydrogen flouride - which has 2-lone pairs on the F atom but only one H atom - which can have a total of 2 bonds.
In solid water (ie, ice), the crystalline lattice is dominated by a regular array of hydrogen bonds which space the water molecules further apart than is found in liquid water. This manifests itself in water's decrease in density upon freezing. In other words, the presence of hydrogen bonds enables ice to float, because this spacing causes ice to be less dense than liquid water.
Were the bond strengths more equivalent, one might instead find the atoms of two interacting water molecules partitioned into two complex ions of opposite charge, specifically hydroxide and hydronium.
Indeed, in pure water under conditions of standard temperature and pressure, this latter formulation is applicable only rarely, on average but once in every 10-14 times (which is the value of the dissociation constant for water under such conditions).
Hydrogen bonding also plays an important role in determining the three-dimensional structures adopted by proteins and nucleic acids (see protein folding problem) In these cases, intramolecular hydrogen bonding between groups in the protein or nucleic acid result in folding of the molecule into specific shapes thus affecting molecular function.
In proteins hydrogen bonds form between the backbone oxygens and amide hydrogens. When the spacing of the amino acid residues participating in a hydrogen bond occurs regularly between positions i and i+4, one has an alpha helix. When the spacing is less, between positions i and i+3, then one has a 310 helix. When two strands are joined by hydrogen bonds involving alternating residues on each participating strand, a beta sheet is formed.