The grammatical difference between definite noun phrases and indefinite noun phrases used in titles that refer to the titular character are the same as the grammatical difference between definite noun phrases and indefinite noun phrases elsewhere. Thus, to determine the 'best' or 'correct' option for any given title is to understand the actual grammatical points and proceed accordingly.
To start, notice that English does not have the "specific article" and the "unspecific article" but the definite article and indefinite article. That is, the English articles mark for definiteness, they do not mark for specificity. Definiteness and specificity are different aspects/qualities of a noun phrase (although most native speakers of English are unaware of this and often conflate the two). See for example Lawler's Distinction between definiteness and specificity at SE: Linguistics.
Thus a noun phrase can be at least three things:
(a) definite and specific
i) I married the woman of my dreams. Her name is Marge.
or
ii) I'm looking for the policeman but I can't find him.
(b) indefinite and specific
i) I married a woman from Illinois. Her name is Marge.
ii) I'm looking for a policeman but I can't find him.
(c) indefinite and not specific
i) I want to marry a woman from Illinois.
ii) I'm looking for a policeman but I can't find one.
(bii and cii are directly from Lawler.)
Note the 'combination' definite and not specific is either unknown or rare in English, so that to my knowledge, a definite noun phrase is by default also specific. This does not mean, however either that (i) definiteness and specificity are the same, or the widely misheld understanding that (ii) the indefinite article refers only to non-specific referents. (Again see the Lawler above.) And for more on the difference between definiteness and specificity see , among others, Barbara Abbott, Definiteness and Indefinite.
Per Abbott and many others, the major difference between definiteness and indefiniteness is that the former marks whether the speaker assumes his hearer can identify which referent the speaker refers to. This is true whether the speaker's assumption is correct or not. But this does not cover all uses of the definite noun phrase; for example definite articles, again contrary to popular belief, are also used to introduce a new topic into a discourse (see, for example, Richard Epstein).
Thus, The girl who wanted to be a boy is a noun phrase that is both definite and specific.
In a title or in narration itself, this refers to a definite, specific girl who wanted to be a boy. Grammatically speaking, as a title alone, the author is presenting the character as one his reader is able to identify. Pragmatically, it draws the potential reader into the story because there's a sense of "shared identity" between author and reader. If we've not read the novel before, this identification comes from the novel. (The author wants us to read the novel after all.) Looked at another way, the definite noun phrase is used to introduce the new topic (that of the specific girl who wanted to be a boy) into the discourse (which is the novel itself).
Either way, the use of the definite article, not surprisingly, gives the title a sense of definiteness. There's no "vaguery" going on. We know immediately from the title that we are meant to be able to identify the titular character. For a real life example, consider the title
The Lord of the Rings
Grammatically, the author is not being vague here. He's being definite, even if it may take some while for the reader to identify who the titular character is. (As a side issue, note that there is a whole lot going on in the novel besides the story of the titular character. Note also that The Lord of the Rings is the title of a novel that because of historical reasons was published in three parts.)
For the same on a less epic scale, there's
The Cat in the Hat
As we've seen above, grammatically
A girl who wanted to be a boy can be either indefinite and specific or indefinite and non-specific. In most cases it will be the former because the novel is about a specific character. Consider the novels
A Single Man by Christopher Isherwood (1964)
and
An Artist of the Floating World by Kazuo Ishiguro (1986)
These titles use indefinite noun phrases. They are each about a specific character, but the grammatical notion of definiteness is not included. The titles/noun phrases are indefinite but specific. Grammatically this means that by the title alone the author has not assumed that the reader will be able to identity who the referent is. This is, literally, a more indefinite approach, one that lacks definiteness. But it does not mean that the novel will be any less focused on the titular character than had the novel used the definite article to present him or her. Again, see Abbott for more on the technical differences between definiteness and indefiniteness. She's written several papers on the subject.