If you just leave your apartment before your lease is up and do not break the lease with your landlord then you can still be obligated to pay the rent due for that duration of the lease.
If you walk out on the lease and still have time left on the lease for the apartment and do not break the lease with the landlord first then you could actually have to go to court and be ordered to pay the rest of the money for the entire duration of the lease.
So you may have to pay the rent for the rest of the years lease even if you do not live there.
If you need to break a lease it's best to speak with your landlord about the lease and let them know you need to leave the apartment and need to get out of the lease.
Then the landlord can decide to break the lease for you and then you won't have to go to court on it.
The landlord can also rent out the apartment as soon as possible so when you break the lease you need to get your stuff out of the apartment soon.