I was just thinking. Would one possible way of working out which is counterpoint and which is harmony, be to figure out what the harmonic rhythm is. Write out all of the notes and then stack the notes in to thirds and see which one makes sense in tertian harmonic writing and then the other notes would then be judged as counterpoint?
"Write out all of the notes and then stack the notes in to thirds and see which one makes sense in tertian harmonic writing and then the other notes would then be judged as counterpoint?"
Or as passing notes, unprepared suspensions... There's usually a way to explain any note within a harmonic framework if that's what you WANT to do. And there's usually a way to explain any set of notes as a chord, if THAT's your aim.
In practice, most music contains both. Even a hymn tune takes account of voice-leading. Even a fugue will have harmonic shape.
In general, as others have already stated, the two aren't really separable. Good composers care about how one note leads to another in various lines, even if some notes of those lines might also be viewed as a vertical "chord."
The only reason to try to separate out "harmony" from "counterpoint" is perhaps to identify "chord tones" vs. non-harmonic tones, which perhaps the question is about. Part of the question with that approach is to ask what you're defining as a "chord." If you're doing a Roman numeral analysis exercise, you are generally limited to certain types of triads and seventh "chords" as your entire harmonic vocabulary. If that's what you're limited to in defining "chords," then your strategy...
Write out all of the notes and then stack the notes in to thirds and see which one makes sense in tertian harmonic writing and then the other notes would then be judged as counterpoint?
... is probably a good starting point. It can sometimes fail, as you might be able to create multiple valid stacks of thirds in a particular beat/measure/rhythmic unit, at which point you need to make reasonable assumptions to decide between the possibilities. (For example, dissonant notes on strong beats tend to be more rare in classical style than on weak beats, with a few exceptions like suspensions. So you might prioritize notes on strong beats in your third-stacking exercise.)
Also, when analyzing highly chromatic music, sometimes you might be able to pluck out a stack of thirds that theoretically seems to be a triad or seventh chord, but it has no clear harmonic function that relates it to what comes before or after. In that case, I tend to think of the structure only as a "voice-leading chord," i.e., a confluence of notes that vertically looks like a chord, but mostly is just a temporary resting place as the various contrapuntal lines move toward something else that is more functional within the harmony.
In similar cases, it can make sense to consider what the point is in labeling a "chord" -- are you just trying to slap a label on a vertical collection of notes? If so, and if the particular moment is so full of chromatic notes that you're having trouble coming up with a stack of thirds, maybe that's not a very good description of what's going on in the music at that point anyway. A harmonic label is usually also used to represent function, and harmonic function often tells you something about the counterpoint (e.g., sevenths in seventh chords almost always resolve down, leading tones resolve up in dominant function chords, etc.). If your chord label conflicts with the actual counterpoint of how the notes move, why are you bothering with the label?
Which leads back to the original assumption I made earlier -- i.e., that you were doing some sort of Roman numeral analysis where only certain triads and sevenths sonorities count as possible "chords." If you're trying to understand how a particular historical composer actually understood the harmony and counterpoint, realize that they may not have made the same assumptions you may have about what can be a valid "chord."
For example, a composer trained in 18th-century figured bass notation would view a 4/2 figure as implying that the bass was a dissonance that had to resolve down by step. The 4/2 vertical structure could be thought of as a "chord," but it had counterpoint implications. Similarly, a 6/4 figure implied a dissonant "chord" in such a period too, where the fourth above the bass was required to resolve down by step in almost all circumstances. Today we might place a Roman numeral and call something V4/2 or I6/4 but to a historical composer neither the 4/2 or 6/4 was necessarily more part of the "harmony" in a piece than a 9/7/4 figure (which would not normally be labeled as a "chord" with modern Roman numerals, but which had rules about its use in figured bass too, including where the various notes were likely to move).
Which leads back to the opening point: counterpoint is really inseparable from harmony. Historically, there were lots of rules about dissonances and their appropriate resolution, so only vertical structures that contained merely a third, and/or a perfect fifth or sixth about the bass could truly be "harmonious." All other vertical structures were dissonant and had rules governing the counterpoint the dissonances had to move within.
In many cases you can easily tell by eye that a voice leading is more harmony based or more counterpoint. Each voice has aspects of harmony and mostly you can say when the counterpoint aspect is dominating: rhythmical movement and imitation!
Originally the tenor (lower voice was the cantus firmus and the upper voice was counterpoint. But then the cantus firmus was notated in the deskant and the lower part was composed as counter point. So the development goes from counterpoint to harmony (homophony).
In the earliest 2 voice madrigals of the 14 century you can't tell which line is the cantus firmus and which the counter point. Same case you can find in some inventions by Bach, where sometimes only the final clause e.g. a bass figure are definitely c.p.
If you consider some voice leadings of Bach where the voices are crossing and the notes are clashing (e.g. 7h and 9th) you can be sure that this is just counterpoint.