How deep are gas lines and electrical lines under ground (to code)?
Typically they will be at minimum, 18" below grade. However this is the grade at the time they are placed.  Soil will compact and erode with time which would result in them being shallower than expected. Frost heaving might also raise them.

The depth requirements only applies to line-voltage lines.  Typically low-voltage lines would not be buried at this depth. Likewise, telco lines are often found significantly shallower, maybe only an inch or two below. 

If you know lines are present, the best thing you can do is carefully hand-dig around them.

A lot of telco's will not even properly locate their lines and instead will just fix them quickly when you end up slicing them.  Annoying indeed.