Let $X$ be a normal complex affine algebraic variety. Suppose that $Y$ is an open subvariety of $X$, and that the codimension of $X\setminus Y$ in $X$ is at least $2$. One version of the Hartogs Theorem is that the restriction map $\mathbb{C}[X]\rightarrow\mathbb{C}[Y]$ is surjective. I am curious about whether there is a version of the Hartogs Theorem for extending sections of canonical bundles. Specifically, if $\alpha$ is a global section of the canonical bundle on $Y$, does there exist a global section $\beta$ of the canonical bundle on $X$ such that $\beta\vert_Y=\alpha$? I would appreciate any and all references and suggestions.

I think the property you want is that the canonical sheaf $\omega_X$ is S2. Note that on a normal affine variety, $\omega_X$ is not necessarily a line bundle (it is if $X$ is a complete intersection though). For simplicity, let's assume $X \subseteq A^{n}$ is of dimension $d$. Then $$ \omega_X = Ext^{nd}(O_X, O_{A^{n}}) $$ is a S2 sheaf. This implies that it satisfies Hartog's theorem. Not all sheaves do! For example, the ideal sheaf of a maximal ideal obviously does not (assuming $\dim X \geq 2$). For a reference which discusses the S2 condition and relation to Hartog's phenomenon, see for example Hartshorne, Generalized divisors on Gorenstein schemes. I think Sándor Kovács has also written several good answers explaining this connection on mathoverflow. A proof of the S2ness of $\omega_X$ for varieties can be found in KollárMori, Birational geometry of algebraic varieties. Another proof can be found in Hartshorne's Generalized divisors and biliaison. 

