It typically takes about 2 to 3 years for a goji berry tree to bear fruit when grown in containers. However, this can vary depending on various factors such as the age of the plant when it was transplanted, growing conditions, and care provided.