Legally, the answer depends on your location. Most places have compulsory education laws requiring students to attend school until a certain age (usually 16 or 17) or until they complete a certain grade level (often 8th or 9th grade). Therefore, while you *might* be able to leave school in 7th grade, it's highly unlikely to be legal without parental consent and the involvement of your school district. They might offer alternative educational options instead of outright allowing you to drop out.
In short, while technically you *could* try, it's almost certainly illegal and not advisable. You should talk to your parents, guidance counselor, or another trusted adult at your school if you're considering leaving school. They can help you understand your options and find a better solution than dropping out.