Definition

A topological space is connected if it is not a union of two non-empty open sets.

i.e. if you draw the two non-empty open sets on the graph, if you have to lift your pen, it will not be connected.

Examples

Not connected:

Connected: