Changing the margins doesn't help in this case because they just add fixed space in addition to your axis label. You could pad your axis label to your expected maximum length to keep the dimensions the same, it's not the most elegant solution but I don't think element_text
can do a fixed width at the moment (maybe someone can correct me on this). Anyways, you could try one of these:
ylab(sprintf("%40s", "sample_title"))
(padding the axis title to 40 characters with spaces - although total width will still vary depending on your font)
ylab(paste(sprintf("%40s", ""), "\nsample_title\n")
(adding a line of 40 spaces above your axis title and an empty line below - should always give you the same width as long as the axis title isn't longer than that)