This is Classic Puzzle type which appeared in many of the World Puzzle Championships and now it is appearing in 1st episode of Puzzle Ramayan. Fences puzzle is also known as Loop the Loop or Slither Links puzzle. However I will be using name as Fences for this type of puzzle as this is the standard name for this puzzle type.
This Fences is very old puzzle which I created long back and now re-publishing as 19th puzzle in Mini Puzzles Series.
Rules of Fences puzzle
Draw a single closed loop by connecting neighboring dots/"along the edges" horizontally or vertically (but not diagonally). A numbered square indicates exactly how many of its edge segments are used by the path.