Does Google refer to the title tag, h1 or slug to be used as sitelinks text? Could the length of titles be penalyzing for sitelinks being showed or not?
It varies. Google takes all the context into account. For one of the larger sites I manage, Google displays the anchor text from the top navigation, which is shorter than the title and h1, and longer than the slug. Since our top navigation forms the most links to the pages displayed as sitelinks, it looks like whatever the most common anchor text is, is what Google prefers for this site.