The domain of a function is the complete set of possible values of the independent variable.
In plain English, this definition means:
The domain is the set of all possible x-values which will make the function "work", and will output real y-values.
So for Graph 1 the domain is : (-∞,∞)
domain for graph 2 is : [-1,5]
The range of a function is the complete set of all possible resulting values of the dependent variable (y, usually), after we have substituted the domain.
In plain English, the definition means:
The range is the resulting y-values we get after substituting all the possible x-values.
So range for graph 1 is (-∞,∞)
range for graph 2 is [-1,2]