#Japt, 42 37 33 bytes
Japt is a shortened version of JavaScript. InterpreterInterpreter
V=Un oU+1;Vr@X+(Vf_p2 +Y*Y¥U)l ,0
###How it works
// Implicit: U = input number
V=Un oU+1 // Set variable V to range(-U, U+1). Ends up like [-U,-U+1,...,U-1,U]
Vr@ ,0 // Reduce each item Y in V with this function, starting at 0:
X+( l // Return the previous value X + the length of:
Vf_p2 // V filtered by items Z where Z*Z
+Y*Y==U) // + Y*Y equals U.
// This ends up as the combined length of all fitting pairs of squares.
// Implicit: return last expression
Perhaps there's a better technique; suggestions are welcome.