Nomenclature rules are complex. We will only attemp to give names to relatively simple molecules. Look at the following examples of representative molecules bearing carbonyl groups.
When they are the main function, aldehydes and ketones hold the sufixes -al and -one, respectively.
As usual, one should select the longest possible chain containing the carbonyl and the most part of the remaining functions.
The numbering should start by the aldehyde. In the case of a ketone, the numbering will be such that the carbonyl holds the smallest possible numeral.
Not always the aldehyde or ketone will be the main functional group. Look at the examples where that happens and draw your own conclusions.