What is the advantage of having stomata open during daytime and having them closed at night?

What is the advantage of having stomata open during daytime and having them closed at night?