This is also known as sleep talking, somniloquy, or nocturnal talking.
Somniloquy is a common sleep disorder that can occur at any age. It is usually harmless and does not require treatment. However, if sleep talking is accompanied by other sleep disturbances, such as sleepwalking or nightmares, it may be a sign of a more serious sleep disorder.