This paper deals with the maximal abelian dimension of a Lie algebra, that is, the maximal value for the dimensions of its abelian Lie subalgebras. Indeed, we compute the maximal abelian dimension for every nilpotent Lie algebra of dimension less than 7 and for the Heisenberg algebra , with . In this way, an algorithmic procedure is introduced and applied to compute the maximal abelian dimension for any arbitrary nilpotent Lie algebra with an arbitrary dimension. The maximal abelian dimension is also given for some general families of nilpotent Lie algebras.