It is well known that every rational integer has a finite or periodic p-adic expansion. In this paper a more general notion of p-adic expansion is introduced for algebraic integers, where given a number field K and a principal prime ideal p in K, a different choice of generator for p is allowed in each stage of the expansion. With the notion of p-adic expansion, we prove that there is always a finite or periodic p-adic expansion for every algebraic integer. Moreover, we prove a bound on the periodicity of the p-adic expansion that depends only on the number field K and the prime ideal p. The proof yields an algorithm for constructing such a p-adic expansion for elements in the ring O of algebraic integers of K, through finding an approximation to the closest vector on the lattice spanned by the unit group of O.As a special case we prove that, similar to rational integers, Gaussian integers are finite or periodic not only in p-adic expansion but also in π-adic expansion, where a fixed generator π for p is used in each stage of the expansion. Moreover, the time complexity of finding a π-adic expansion for a Gaussian integer is polynomial in the length of input, the period, and p, where p is the rational prime contained in p. We implement the algorithm for some quadratic number fields and provide examples which illustrate that the p-adic expansion of the elements in O is either finite or periodic.