Is a dialogue a lengthy speech given by a character

No, a dialogue is a conversation between two or more characters in a literary work or play. It consists of alternating lines spoken by each character, rather than one character giving a lengthy speech.