What you are calling the range would more commonly be called the codomain of the function (the range is then defined as the image of the domain, i.e. for $f:A\to B$, the set $\{f(x) : x\in A\}$. With this in mind, the answer is:
- yes, whether a function is surjective depends on the codomain.
- no, whether a function is injective does not depend on the codomain (it depends on the domain)*
For example, the function $f:\mathbb R \to \mathbb R$ defined by $f(x)=x^2$ is not a surjection. But the function $g:\mathbb R \to \mathbb R^+ \cup \{0\}$ defined by $g(x)=x^2$ is a surjection.
In general, this is why we ought to specify the domain and codomain whenever we define a function: the functions $f$ and $g$ above are different functions even though they map the same inputs to the same outputs. Surjectivity is a property of a function fully defined, rather than something that can be determined just from the inputs and outputs.
Indeed, sometimes we rely on these facts in order to make a function invertible. For example, $\sin:\mathbb R \to \mathbb R$ is neither injective nor surjective, and hence does not have an inverse function. However, if we restrict it to the function $\sin: [-\frac{\pi}{2}, \frac{\pi}{2}] \to [-1,1]$ the new function is bijective and we can obtain $\sin^{-1}$.
*A sketch proof. Consider $f:A\to B_1$ and $g:A\to B_2$ where $f(x)=g(x)$ for all $x \in A$, and ensuring that $f(A)\subseteq B_1,B_2$ (a function cannot be defined with a codomain that does not include the range, so this assumption is not problematic). $f$ is injective iff $f(a_1)=f(a_2) \Rightarrow a_1=a_2$, and $g$ is injective iff $g(a_1)=g(a_2)\Rightarrow a_1=a_2$. But since $f$ and $g$ map $a_1$ and $a_2$ to the same elements of the range, these criteria are equivalent so $f$ is injective iff $g$ is. Hence injectivity does not depend on the choice of codomain.