You have to close the gate at night.

Literal

Night [topic-は] gate [obj-を] close-[keep-ておく]-[must-なければなりません].

しめておく ('close and leave closed') — ~ておく marks the intent that the closure persists. ~なければなりません is the polite obligation form. A household/security instruction, typical of traditional Japanese homes where the gate は is a prominent boundary marker.