How do you say "Do you speak Chinese?" in Mandarin and Cantonese?
Mandarin

你会说汉语吗？ (Ni3 hui4 shuo1 han4 yu3 ma5) 

Or polite form: 您会说汉语吗？(Nin2 hui4 shuo1 han4 yu3 ma5)



Of course, you can say 中文 (zhong1 wen2) instead of 汉语. That is not the big question here, but rather that you have to include 会, which underlines that you ask if the person you are speaking to, can speak Chinese or not. Only asking 你说汉语吗？ is not sufficient, it means "Do you use Chinese (in general)?, e.g. 你家里说中文吗？ Do you speak Chinese at home? (what is being asked is not the ability, but the fact if Chinese is spoken or not.)



Cantonese
你識唔識講中文啊? (Nei5/Lei5 sik1 m4 sik1 gong2 zung1 man4 aa3, I am using Jyutping here, but Yale is a similar transcription). 

If you want to ask "Do you speak Chinese?" in Cantonese, you ask Chinese (中文), not Cantonese. I really don't understand why one would think Cantonese is not Chinese. So ask for 中文 not 廣東話. If you want to ask if someone specifically can speak Cantonese, then use 廣東話.



Notes:

(1) The Mandarin text uses simplified characters, as most Mandarin speakers use these, the Cantonese question uses the traditional ones, as most Cantonese speakers who are familiar with writing Cantonese are Hongkongers, who use traditional characters, but simplified characters are used by Cantonese native Mainland Chinese who can read and write Cantonese or at least have some experience with it. 

(2) The Cantonese pronunciation is difficult to transcribe, there is a difference between Mainland Cantonese and Hong Kong Cantonese, e.g. 你 begins with 'l-' in "lazy speech", i.e. casual Hong Kong Cantonese, but 'n-' is a more formal, "proper" sound, especially used in the Mainland. 

(3) The word "Chinese (language)" has many equivalents in (Mandarin) Chinese, all differ in some way. 


汉语, the language of the Han
中文, the (written) language of the Chinese civilization 
华语, Chinese as the language of Overseas Chinese, whether Mandarin, Cantonese, Hakka, or any other dialect, as contrasted to the non-Chinese languages, like English, Malay or Thai, etc.
中国话, less used, means "the (spoken) language of China".  
国语, ("national language"), i.e. Mandarin Chinese, this expression is mostly used outside the PRC
普通话 ("general language"), also Mandarin Chinese (or sometimes called Standard Chinese), this word is used in the PRC, which promotes Mandarin Chinese and discourages speaking dialects in public. 
官话 ("official language"), Mandarin Chinese, this word has historic connotations, the Ming and Qing-dynasties, under which the Northern dialects gained the status of official language of the administration and the "Mandarins".