Don't know how many miles you have, or if you are first owner, but that may not be the problem.
If it occurs only when in 4x4 mode, it could be one of the differentials, thinking it could be a popper in the front case used on some 4x4 to unload pressure off the axles. Second, normal, but that is assuming you are unfamiliar with 4x4 operation and it is the normal slap of gears as the tires slide relieving pressure off the axles.
Lastly, as a CV joint, I would think if it were a CV you would hear it all the time when making turns in 4x4 or not. Front U joint, could be dangerous depending on how it is aligned, mine has a bar that prevents the front shaft from dropping to the ground.
When, I think you are probably fine for a month, maybe even 2. The likely hood of follow on damage is very low. When you do have them replaced, have both replaced. I have actually heard of people replacing only one, and then have to go back soon after for the second