When must airliners follow airways?
Commercial airliners generally fly IFR as such they do what ATC tells them to do. They are not free to chose their own path. The airway system in the USA and elsewhere on the globe stems from the pre-GPS era when VOR's and other ground based nav aids were the predominant method of navigation. Airways tend to be either between VOR's or between points you can triangulate with a VOR. The system was built around this idea of traffic routing and in the GPS days it has simply stuck. As the FAA shuts down VOR's slowly some of the airways remain and seem a bit arbitrary but GPS allows us to follow them easily.  

The FAA has a brief on it here.

Broadly speaking aircraft can request a deviation for weather or other inflight issues like turbulence but aside from that courses are followed as they are assigned. 

The FAA has discussed routing directly but until the nextGen system is in place its likely not going to be a widespread reality. 


  What differences (if any) are there between traffic over sea and over land?


At least over the Atlantic there is the North Atlantic track which is a set of predefined routes. Since there is no ATC over the ocean aircraft do a certain amount of self regulating.