Bilbo never married so he had no heir. then he found Frodo. Frodo parents were killed in a boating accident and that left Frodo and orphone. Bilbo decieded to adopt Frodo and that is their relationship.
I don't know exactly where it says this, but it is in the Hobbit somewhere.... Hope this answeres your question.