As the previous answerers noted, both phrases are grammatical, but awkward socially if said during an introduction.
That doesn't mean there isn't a place for them (or similar phrases).
"I hope we can spend some time together" is a good way to signal a casual friend you don't know well that you are interested in a romantic relationship, but with low pressure.
"I hope we can be friends" is a good phrase for clarifying intentions. For example, if you get the feeling someone is interested romantically but you just want normal friendship. Or if there was some conflict or disagreement you just settled and you want them to know that you are open to friendship.
But with someone you don't know, the best way to make friends is to start acting like a friend. Offering help with something works if you see the person needs something, but you can just start with small talk and then introduce yourself.