Territorial waters are like a big swimming pool around a country that is next to the ocean. Just like how your parents set rules for you in your own swimming pool, countries get to make rules for their territorial waters. They get to decide what people can do in their waters and what they can't do.
These rules include things like fishing, boating, and putting pipelines under the water. Other countries and people have to follow these rules when they are in the swimming pool, or they may get in trouble.
Territorial waters extend out from the country's shores for about 12 nautical miles (like you might count 12 steps when you play hide and seek). Beyond this limit is called the "high seas," where different rules apply and countries don't have as much control.
So, think of it like this - just like you have control over your swimming pool, countries get to have control over what happens in their own "swimming pool," which is their territorial waters.