New York State considers you a resident for income tax purposes if you maintain a permanent place of abode in New York State for more than 11 months of the year and spend 184 days or more in New York State during the tax year. Note: Any part of a day is a day for this purpose. New York City follows the same criteria.
A leased apartment would be considered a "permanent place of abode".
ALL the income of NY residents is taxable by NY, regardless of where it was earned.
https://www.tax.ny.gov/pit/file/pit_definitions.htm
**Answers are correct to the best of my ability but do not constitute tax or legal advice.