I understand what phrase, clause and sentence mean. But is there a term for a group of words with a clear beginning and end, regardless of whether it's a phrase, clause or sentence?
The general term for any chunk of language that's self-contained -- a phrase, a clause, a sentence -- is Constituent. Syntax is all about constituents, because syntactic processes only apply to constituents of utterances. No syntax rules apply to random strings of words; they're not language.
For instance, Extraposition is a typical syntactic rule, which moves heavy clauses and phrases from subject position to the end of a sentence, leaving behind a dummy (non-referential) pronoun it to hold the Subject slot.
- For him to stay late would be a bad idea.
== Extraposition ==>
It would be a bad idea for him to stay late.
For him to stay late is a constituent, an infinitive clause, with the infinitive subject noun phrase constituent him marked by the complementizer for, and the infinitive verb phrase constituent marked by the complementizer to; and the whole constituent is moved as a unit by the transformation to the end, where it's easier to process. The it is necessary because a sentence constituent must have a subject constituent, even though it doesn't have to mean anything.
For more details on constituents and how to identify them, take a look at chapter 3 "Tests for Constituency", in this book.
There are some terms of interest in that field, the most general of them is collocation assuming no specific relationship between the words. Then, there is multi word expression assuming that the words form a semantic unit, and there is formulaic expression assuming that the word have a common pragmatic function. There is also the term translation unit from translation studies, describing a group of words treated as a unit for translation.