Two ways of writing the same wish
Swedish dictionaries record both god natt and godnatt. They represent the same farewell rather than different levels of politeness. You may meet the joined spelling in messages and in compounds such as godnattsaga, a bedtime story. The two-word version is a useful starting point for learners. In ordinary speech the d in god can disappear, leaving a short transition straight into the strongly stressed natt. Listen for that compact rhythm instead of pronouncing every written letter separately.
Make your farewell fit the relationship
The verb in Sov gott is the command form of sova, to sleep, but the complete expression functions as a friendly wish rather than an instruction. Adding så makes it sound more emphatic. With a child, Natti natti has a playful quality comparable to nighty-night in English. A wish for pleasant dreams can be lovely in a message to a partner, whereas a simple night-time farewell is less personal and works well with someone you have just met.
Ending a conversation rather than opening one
When arriving at an evening event, choose Hej or God kväll instead of God natt. The distinction does not depend on a particular hour: even if it is quite late, you may still be starting a conversation. At the end of a visit, God natt signals that the encounter is finished for the night. If tomorrow is already planned, a combined good-night wish followed by a reference to seeing each other again can close the conversation naturally. The context matters more than the length of the daylight.