If you poke around the internet, you will find posts by various wise writers exhorting you to spend x amount or proportion of your time marketing and the rest writing. Often it comes down to 80% writing and 20% marketing.
I think these sorts of enforced schedules miss a really important part of being a writer:
Marketing is not some evil thing that should be avoided at all cost, nor is it something that takes you away from writing, or something that needs to be rationed.
Marketing augments your writing. Marketing sells what you have already written, increasing the value obtained from your intellectual capital. Marketing can also help you decide what to write next: see what sells best, and then write more of that.
How much time do I spend doing either? However much is necessary. If I’m in the middle of an early draft of a book, I’ll spend next to no time marketing, but when I need to think about how plot threads fit together, I move to do more marketing, because most of it involves interacting with people and it takes your mind off thorny plotting problems, and that ironically helps you see the solutions that have been staring you in the face all the time.