Not a complete answer, but here are some examples which might be informative:
First consider a finite-dimensional Lie algebra $L$ over an arbitrary field $k$. Assume that $L$ is concentrated in purely even degrees. Set $d = dim(L)$. Let $U(L)$ be the universal enveloping algebra of $L$. Then there is a standard (finite!) $U(L)$-free resolution of the trivial module $k$,
$$P_\bullet: U(L) \otimes \Lambda^d(L) \rightarrow U(L) \otimes \Lambda^{d-1}(L) \rightarrow \cdots \rightarrow U(L) \otimes \Lambda^1(L) \rightarrow U(L) \rightarrow k,$$
where $\Lambda^\bullet(L)$ denotes the exterior algebra on $L$. Since $U(L)$ is a Hopf algebra, it follows for any (graded) $L$-module $M$ that $P_\bullet \otimes M$ is a $U(L)$-projective resolution of $M$. Then $\textrm{Ext}_{U(L)}^i(M,-)=0$ for $i > d$, so $\textrm{gl dim}(L) \leq d = dim_k(L)$. If $L$ is abelian, then one gets
$$\textrm{Ext}_{U(L)}^i(k,k) \cong \textrm{Hom}_k(\Lambda^i(L),k) \cong \Lambda^i(L^*)$$
and hence $\textrm{gl dim}(L) = d$.
On the other hand, let $L$ be a one-dimensional abelian graded Lie algebra spanned by an element $x$ of $\mathbb{Z}$-degree $1$. Assume that $k$ is not of characteristic $2$. Then
$$U(L) = k[x]/(xx-(-1)^{1 \cdot 1}xx-0) = k[x]/(x^2+x^2) = k[x]/(2x^2) = k[x]/(x^2)$$
i.e., $U(L) = \Lambda(x)$ is an exterior algebra generated by $x$. Then a minimal projective resolution of the trivial $L$-module $k$ is given by the periodic resolution
$$
k \leftarrow \Lambda(x) \stackrel{x}{\leftarrow} \Lambda(x) \stackrel{x}{\leftarrow} \cdots
$$
in which the arrows denote multiplication by $x$. From this it follows that $\textrm{Ext}_{U(L)}^i(k,k) \neq 0$ for all $i \geq 1$, and hence $\textrm{gl dim}(L) = \infty$.