Yes, there is a limit, you can add 6 hash characters the most.
# h1## h2### h3#### h4##### h5###### h6In case you were asking if there is a limit of using headers in markdown, the general rule is to use only 1 # H1 - this is the title of the post/page. The other headers are generally speaking unlimited, but you should not overdo them. It all depends on the context.
E.g. You have a blog post named "5 steps for making Turkish coffee"
In this context, I don't know what h4-6 would be used for. People really rarely use those.