What's the total variation of a step function of two variables? Like, $$f(x,y) = \begin{cases} 1 \quad &\text{ when } 0<x<a,\ 0<y<b; \\ 0 \quad &\text{ otherwise}\end{cases} $$
Is the total variation the step size $1-0=1$?
What's the total variation of a step function of two variables? Like, $$f(x,y) = \begin{cases} 1 \quad &\text{ when } 0<x<a,\ 0<y<b; \\ 0 \quad &\text{ otherwise}\end{cases} $$
Is the total variation the step size $1-0=1$?
The definition of total variation for functions of more than one variable (found on Wikipedia) is not as simple as for one-variable functions. It has less to do with "sum of jumps of the function" definition and more with the property that total variation is (sometimes) the integral of the absolute value of the derivative. Here, one must be very careful with the definition of derivative used (distributions have to be involved).
But informally, you can derive the correct value by approximating $f$ with continuous functions $f_n$ in a natural way (their graphs will look like truncated pyramids), and taking the limit of $\iint |\nabla f_n|$ as $n\to\infty$.
For the function you gave, the total variation is $2(a+b)$, the perimeter of the rectangle.
In general, the total variation of the function $$ f(x,y) = \begin{cases} 1 \quad &\text{ when } x\in E \\ 0 \quad &\text{ otherwise}\end{cases}$$ is the perimeter of a set $E\subset \mathbb{R}^2$.
(This pattern be recognized in the one-dimensional case too, where the "perimeter" of an interval is always $2$, because the boundary contains $2$ points.)