1) They can't afford to go out very often.
2) They can't afford going out very often.
A native speaker has said that the second usage can be heard in a colloquial speech, but it is incorrect. Is it true?
I searched The Corpus of Contemporary American English (COCA) for both strings. Here's what I found:
There's a strong preference for the infinitival complement, so I suggest that you use it in your own writing.
That said, I would accept the other version as grammatical. This is just my personal judgment, but Jim left a comment which agrees, so I'm not the only one. This may be part of a larger trend that some have called the Great Complement Shift, although at the moment the infinitive is still strongly favored; there isn't much evidence in favor of a shift to the gerund for this particular verb yet.
Of the five results in COCA for afford going, four are from the spoken language sub-corpus, and one is from the news sub-corpus. This, along with the relatively small number of results, supports the idea that it might be considered more colloquial.
Both are okay. Nevertheless, COCAE shows the verb afford + to + infinitive quite common similar to the examples you stated.
I think the verb afford just like love and hate takes both - gerund and infinitive after it.
This is all about verb pattern.
The Collins dictionary (online) has only to afford to do. Obviously for AmE the problem is a bit different, but I would say the normal verb construction is to afford + to-infinitive. But I'm not astonished that some people in spoken language use the gerund after to afford. Simply because the borderline between to-infinitive and gerund after a verb is overlapping and the borderline that grammars draw is actually a bit arbitrary and mainly due to convention.
But people don't speak English with a grammar in their hand. And so you can hear sometimes a gerund used as object after a verb even when grammars say the normal verb construction is verb + to-infinitive.