I have to cope with a constraint of the form (1) in the following problem:
$$\begin{align}\max\quad& x+y\\ \text{s.t.}\quad& x + y \leq \max \{x,y\} &(1)\\ &0 \leq x \leq U_x&(2)\\ &0 \leq y \leq U_y&(3)\\ \end{align}$$
In the following link you can find an approach but I don't understand it.
https://www.leandro-coelho.com/how-to-linearize-max-min-and-abs-functions/
I don't understand: what is $S^+$, $S^-$ and how would a penalization look like? (I refer to the text: "The max function can be linearized as follows: ..." in the reference).
I would be grateful if somebody could help.
The linked figure shows the problem in LP Format and the solution.
The reformulation in the link isn't guaranteed to work. In this case, it doesn't, because the feasible region is not convex. You cannot express a non-convex feasible region with linear constraints.
To see that it is not convex, note that if $x\geq y$, then $x+y\leq x$, so $y=0$. Otherwise, $y>x$, so $x+y\leq y$ and then $x=0$. Therefore, either $x=0$ or $y=0$.
We have feasible solutions of $(x,y)=(U_x,0)$ and $(x,y)=(0,U_y)$. If the feasible region were convex, a convex combination of those would be feasible, like $(x,y)=\frac{1}{2}(U_x,U_y)$. However, it's not feasible unless $U_x=0$ or $U_y=0$.
So for general $U_x,U_y$, you can't use this reformulation. Instead, you'll probably want to introduce a binary variable, and solve a mixed integer programme. Or, in this case, by inspection.