Yes, you are permitted to leave Canada while studying. You may, however, need to show proof that you are enrolled in a Canadian school before you are allowed back into the country.