Following the usual definition of length of a curve, the curve have to be rectifiable to have finite length. However for example the curve
$ \gamma \colon [0,1] \to \mathbb{R}, t \to t \cos^2(\pi/t) $
is not rectifiable. However I would say it makes perfectly sense to say it has length $1$.
So my question is, if there is a more general definition of length of a curve such that my example above has length $1$ (however such that for example the graph of the function $\gamma$ above has infinite length).
You have to distinguish between the ${\it curve}$, i.e., an equivalence class of maps $f:\ [0,1]\to {\mathbb R}^n$, and its "trace", i.e., the ${\it set}$ $f\bigl([0,1]\bigr)\subset{\mathbb R}^n$. If you declare your curve $\gamma$ to have length $1$ you would have to assign a twice surrounded circle the length $2\pi$. In this example the length of the "trace" is indeed still $2\pi$, but the length of the actual curve is $4\pi$.