The puzzle you're describing is Slitherlink (also called Fences, Loop the Loop, or Dotty Dilemma).
Want a beginner 5×5 to try? I can generate one.