They both come out once every month. They're both in English. Both published in the United States. Both of them are "factual".They both have pictures. They even cover some of the same topics.
The difference is that one--Oceanography--is peer-reviewed, whereas National Geographic is a popular-press title.
Peer review is scientists' and other scholars' best effort to publish accurate information. Each article has been submitted by a researcher, and then reviewed by other scholars in the same field to ensure that it is sound science. What they are looking for is that:
It isn't a perfect system: Scientists make errors (or commit fraud) as often as any other human being and sometimes bad articles slip through. But in general, peer-review ensures that many trained eyes have seen an article before it appears in print.
Peer-reviewed journals are generally considered "primary source" material: When a new scientific discovery is made, a peer-reviewed journal is often--but not always--the first place it appears.
Popular and trade publications are not peer-reviewed, they are simply edited. That does not mean they are any less potentially truthful or informative--most popular and trade publications take pride in careful fact-checking.* But when the topic is scientific research, the information is generally "secondary": It has already appeared elsewhere (usually in a peer-reviewed journal) and has now been "digested" for a broader audience.
Peer-reviewed journals will always identify themselves as such. If you want to verify that a journal is peer-reviewed, check Ulrich's Periodical Directory.
Some sources of peer-reviewed articles: