Does an algorithm have to terminate?
Yes, an algorithm should always stop after a finite number of steps, otherwise we would call it a procedure or process or computation specification.  A procedure that doesn't halt for certain inputs can be considered partial algorithms.  Algorithms are more useful, since they terminate for any input.

An algorithm can be viewed as a function $f: \mathbb{N} \to \mathbb{N}$.  if it is defined for all input values, we say that $f$ is "total" ; for an algorithm, it means that it halts for any input.  On the other hand, if a function $f$ is "undefined" for an input, say $4$, we say that $f$ is a partial function, and in computation theory, we write $f(4)\uparrow$ meaning it "diverges", or simply "doesn't halt".

An example for a partial function can be the inverse of the integer square function, i.e. $sq(n) = n^2$.  The inverse, $sq^{-1}$ is defined only on perfect squares, that is, $$sq^{-1}(n) = \cases{\sqrt{x} \text{ if $x$ is a perfect square} \\ \text{undefined otherwise.}}$$