Students can still submit the task after the due date passes. The due date is published to students so they know when they are expected to complete the work, but they can still view, attempt and submit the task after the due date passes.
Setting a due date on your Task is optional; it may be helpful in keeping students accountable.