Oximes are compounds containing a C=N-OH functional group. They are prepared by a condensation reaction of aldehydes or ketones with hydroxylamine under mildly acidic conditions.
The reaction starts with a nucleophilic addition of hydroxylamine to the carbonyl group, which forms a tetrahedral intermediate with a negatively charged oxygen and positively charged nitrogen. This intermediate undergoes a proton transfer, and a new intermediate called a hemiaminal or carbinolamine is formed. Upon protonation of the oxygen, the carbinolamine undergoes an elimination reaction facilitated by the lone pair on nitrogen. This forms the protonated oxime, which is then deprotonated to give the final oxime product:

We could have also shown the mechanism by first protonating the carbonyl group, which makes the C=O carbon more electrophilic. Either way is acceptable, so go with how your instructor shows it.
Like many addition reactions to the carbonyl group, all the steps here are reversible, and the equilibrium can be shifted toward the products by using a larger concentration of the reactants or by removing water from the reaction mixture.
The Reactions of Oximes
The most important reaction of oximes is the Beckmann rearrangement, where an oxime is converted into an amide under acidic conditions. In cyclic ketoximes, this reaction gives lactams, and the migration of the group anti to the hydroxyl group determines the regiochemistry of the product:

Oximes can also be reduced to amines using reducing agents such as catalytic hydrogenation or hydride reagents. Depending on the conditions, reduction can also give hydroxylamines, so the extent of reduction depends on the reagent and reaction conditions.
Like with other imines, another important reaction is hydrolysis, which regenerates the original aldehyde or ketone and hydroxylamine:

