You cannot turn off a campaign automatically at midnight, but you can disable a form within a campaign at midnight so it is no longer available to accept donations/registrations.
You will accomplish this at the form level through these steps:
Step 1: Go into the form that you wish to end at midnight
From the home dashboard, select "Form List".
After navigating to your form list, click on the name of the campaign that will need to be turned off at midnight.
Step 2: Go to the "Form Details" tab
While on the campaign dashboard, click on "Form Details".
Step 3: Click "edit" on the form availability section
Scroll down to "Form Availability" and click on "Edit" to change the times.
Step 4: Select the date and time you wish the form to be disabled.
You can do this through the calendar button:
Note: You'll need to select a day on the calendar before you can select a time!
OR You can type it in:
You also have the ability to include a custom closed message if you wish: