The girl walks by the boy, generally means "the girl walks by the boy (passes by) with her head in the air". I think " the girl walks beside ( or next to) the boy" seems to me a better translation.
Are the στο and στην in these sentences just based on the article of the object?
Στο also covers the usage of "to". I go to the house=πάω στο σπίτι. Few prepositions are accompaigned by genitive, most of them use accusative.