Here is a full overview of the relevant code requirements and the factors that influence how deep your water line has to be.
RUNNING A WATER LINE TO AN OUTBUILDING OR A SHED
Plumbing Blog Kansas City - B&L Plumbing Inc
running water to a detached garage
Depths of Utility Service Pipes and Cables
Waterline Depth: How Deep Should a Waterline Be
How To Keep Pipes From Freezing That Are Underground
How to Repair an Underground Water Pipe
2015 International Plumbing Code and Commentary (IPC) - Chapter 3: General Regulations - 305.4 Freezing.
Yard Hydrant Basics: Things You Should Know
Buried Water Pipe - Blueboard Insulation - Water treatment
RUNNING A WATER LINE TO AN OUTBUILDING OR A SHED