Leo and Stargirl end up being boyfriend and girlfriend, so a reader would assume that they have quite a bit in common with each other and that is why they are attracted to each other. I think that is a pretty good assumption. Leo and Stargirl are not a case of "opposites attract" and, in fact, are fairly similar. They are both are a little bit odd. Keep in mind that Leo likes porcupine ties. That's not something a typical high school boy is going admit to liking. He's a bit quirky; that is what attracts him to Stargirl and Stargirl to him.
Both Leo and Stargirl are also empathetic and loving people. They care for the feelings of others. Stargirl does her random acts of kindness, she cheers for both teams, and she has no problem wishing anybody and everybody a happy birthday. She loves other people unconditionally. Leo isn't necessarily as generous in his love for other people, but he does care for others' feelings. It's why he tries to keep Stargirl out of the Hot Seat for so long. He wants to protect her.
As for differences, Leo cares more about what other people think about him than Stargirl does. Stargirl doesn't care what anyone thinks about her other than Leo. It is why she tries to change for Leo but ultimately chooses to be herself. Leo likes the notion of being himself, but he likes fitting in far more, and that is why he tries to change Stargirl into something that she is not.