When does hydrogen bonding happen?
Most people seems to think that hydrogen bonds are limited to $\ce{X-H\bond{~}Y}$ interactions, where $\ce{X}$ and $\ce{Y}$ are heteroatoms. 

In the crystal, a $\ce{C-H}$ of an aromatic system or a $\ce{C=C}$ double bond can serve as a donor as well and interact with heteroatoms, such as oxygen atoms in $\ce{C=O}$ or $\ce{C_{arene}-O-C_{alkyl}}$. 

These interactions can form complex networks of rings and strands.

We've examined and published that a while ago for a couple of different phthalimides, such as N-(4-methoxybenzyl)phthalimide or N-allyl­phthalimide, and some more. 

While the articles are behind a paywall (they were published before Acta Cryst. E went open source), the CIF files can be downloaded and played with/examined.

A crucial parameter for hydrogen bonds is distance, if the acceptor is too far away, there is (obviously) no hydrogen bond. 

As a rule of thumb, $2.3\,\mathrm{\mathring{A}}$ is a distance where hydrogen bonds can be expected.