The property of connectedness depends on the topology I came across the definition of connectedness and it has been stated as

Definition: A topological space $(X, \tau)$ is connected if the only subsets which are both open and closed are $\varnothing$ and $X$.

Does this mean that the same set $X$ might or might not be connected depending upon how $\tau$, its topology, is defined? Obviously, the trivial topology is always connected. However, is there any theorem which says something about the connectedness of a non-trivial topology $(X, \tau')$ provided we know that there is a disconnected topology on the same set $X$ namely $(X, \tau)$?
Put in other words, is it possible to choose topologies on a set $X$ in a non-trivial manner depending upon whether we need a connected, or disconnected topology?
 A: Regarding your title, regarding whether connectedness depends on the topology, notice that when the concept of a "topology" is defined, at the same time the concept of "open" is also defined:

Given a topology $\tau$ on a set $X$, and given a subset $U \subset X$, to say "$U$ is open" means "$U \in \tau$".

This is like a dictionary entry: everywhere you see the phrase "$U$ is open", you may use your dictionary and substitute that phrase with "$U \in \tau$", assuming of course that a topology $\tau$ has been given.
So, you can rewrite the definition of connectedness in this way. First, introduce a variable:

Definition: A topological space $(X, \tau)$ is connected if the only subsets $U$ such that $U$ is both open and closed are $U=\varnothing$ and $U=X$.

Next, apply the definition of closed:

Definition: A topological space $(X, \tau)$ is connected if the only subsets $U$ such that both $U$ and $X-U$ is open are $U=\varnothing$ and $U=X$.

And, finally,

Definition: A topological space $(X, \tau)$ is connected if the only subsets $U$ such that $U \in \tau$ and $X-U \in \tau$ are $U=\varnothing$ and $U=X$.

And now it is crystal clear: the definition of connectedness depends quite heavily on $\tau$.
So at this stage it should not be a surprise that when you swap $\tau$ out for some other randomly chosen topology $\tau'$ on $X$, the question of whether $(X,\tau')$ is connected is quite independent of the question of whether $(X,\tau)$ is connected.
