According to the data at [the unofficial Wiki][1], a galaxy is composed of 4.2 billion regions (slightly less than 2^32).  Each region can theoretically contain 4096 star systems (2^12), but in practice, far fewer appear on the map\*.  350 systems per region appears to be the average.  Each star system contains between two and six bodies (planets + moons); four planets appears to be the average.

Multiply it all out, and you get roughly 6 trillion planets per galaxy.

<sup>\*Since the game is procedurally generated, the non-mapped star systems can be visited through savegame editing or bugs, raising some interesting philosophical questions about what it means for something to exist.</sup>

  [1]: https://nomanssky.fandom.com/wiki/Galaxy