See the systemd.socket man page. For internet sockets a simple number is indeed a port number and the difference between them is that datagram means udp and stream means tcp.
However, these options can also take values like `/my/file`, when they refer to Unix domain sockets, and the difference is as given in the link by Marko Kosmerl, namely whether a reader can see the boundaries between packets from a writer or not.