There is no real different in the meaning of these two sentences, but USUALLY we use
-the infinitive ("to talk") form when we're talking about the PURPOSE of something,e.g, "I came here to study."(Why?To study=purpose of coming here)
-the For+ing form when we're talking about the FUNCTION of something ,e.g. "A computer is for saving and anazlying data."(What's it for?Saving and analyzing data the= computer's function)