You generally can, but re-entry is not guaranteed. When you return, you may be asked again about your studies and intentions to make sure you still qualify for your F-1 status.