On topic links are links from websites of a similar topic. If your site is about auto body repair, on topic sites would be about cars.
Off topic links are links form website of a different topic. Using the same example as above, a link from a clothing site would be off topic.
One of the problems with the question is there is a grey area.
Are links from insurance sites on topic or off topic? The insurance company website probably contains articles about car insurance, and probably also contains articles about life insurance. On topic? Off topic?
However there is a bigger issue with the question.
Per the 2015 Moz Search Ranking Factors Study, in the category of Page Level Keyword Agnostic Features, the ranking factor that is tied for first place is the number of links. Not the number of on topic links. Not the number of off topic links. The number of total links.
It appears the question is fundamentally flawed as what is best is to have a high number of each.
The next point I wish to make is your time and energy is finite, and time you spend on activity A is time you don’t have to spend on activity B.
So if you’re pursuing obtaining as many on-topic links as possible, are you losing out on quality off-topic links as a result?
If you pursue a campaign of attracting links, are you not likely to attract some on-topic links as well as some off topic links?
Learn More About Attracting Your Audience…SEO Needs Link Building