Latent class models have been widely used in longitudinal studies to uncover unobserved heterogeneity in a population and find baseline characteristics of latent classes simultaneously by using the class allocation probabilities dependent on predictors. However, uncertainty in the choice of the number of classes is a well-known issue on previous latent class models for longitudinal data. To address this issue, we propose a Bayesian nonparametric latent class model for longitudinal data. The proposed model is an infinite mixture model with predictor-dependent class allocation probabilities. An individual longitudinal trajectory is described by the class-specific linear mixed effects model. The model parameters are estimated using Markov chain Monte Carlo methods. The proposed model is validated using a simulated example and a real-data example of characterizing latent classes of estradiol trajectories over the menopausal transition using data from the Study of Women's Across the Nation.