It is well known that habitat boundaries affect ecological dynamics, but their influence on evolutionary dynamics is less well understood. Here, we study the effects of different kinds of boundaries on evolutionary branching in clonal populations along environmental gradients by systematically analyzing individual-based stochastic models in small- and large-range systems, as well as their large-population-size limits through deterministic approximations. Specifically, we examine four prototypical kinds of boundaries: impermeable boundaries at which individuals stop (stopping), or from which they continue back into the interior as if bouncing back mechanically (reflecting), or that let them abort the dispersal attempt, return to their original position and try a different direction (reprising), and semipermeable boundaries that can be crossed without hindrance, but do not allow the crossing individual to return (absorbing).We find that boundary conditions shape branching patterns only in small-range systems, where stopping boundaries generate disruptive selection for a wide range of parameters, whereas absorbing boundaries always generate stabilizing selection. Reflecting and reprising boundaries generate disruptive selection at low individual mobilities, and stabilizing selection at high mobilities. To further analyze these findings, we introduce a simple approximation of the invasion fitness in a mobile population, which predicts the observed outcome. The effect of stochasticity on evolutionary outcomes is small even in small populations: stochasticity causes random branch extinctions at steeper slopes and higher mobilities. In large-range systems, frequency-dependent interactions alone induce evolutionary branching for almost all parameters and independent of boundary conditions.