"on" is commonly used as a replacement for "nous" (probably because it's easier to conjugate verbs for "on"), hence "we". The other use is equivalent to impersonal "you" or "one" in English, eg. "One/You should not go to sleep too late." = "On ne devrait pas aller dormir trop tard."