If a compound has two carbonyl groups (dicarbonyl compound), it undergoes an intramolecular aldol reaction if a five- or six-membered ring can be formed:

What happens is one of the carbonyls is deprotonated at the ɑ position, thus serves as a nucleophile, and attacks the C=O carbon of the other carbonyl. It is always a good idea to number the carbon atoms to keep track of their movement:

Formation of a six-membered ring follows the steps and mechanism – deprotonation, intramolecular aldol addition, proton transfer and E1CB elimination to yield the ɑ,β-unsaturated carbonyl compound:

Notice that the deprotonation of carbon 7 leads to the same product, and in general, it represents the same reaction because of the molecular symmetry.
On the other hand, if either carbon 3 or 5 are deprotonated, the intramolecular nucleophilic attacks leads to a four-membered ring. However, remember that five- and six-membered rings are the most stable and four-membered aldol product is an unfavorable product of this equilibrium:

More Example to Practice Aldol Condensations are given here:
Aldol Addition and Condensation Reactions – Practice Problems
Crossed Aldol And Directed Aldol Reactions
Check Also
- Alpha Halogenation of Enols and Enolates
- The Haloform and Iodoform Reactions
- Alpha Halogenation of Carboxylic Acids
- Alpha Halogenation of Enols and Enolates Practice Problems
- Aldol Reaction – Principles and Mechanism
- Aldol Condensation – Dehydration of Aldol Addition Product
- Intramolecular Aldol Reactions
- Aldol Addition and Condensation Reactions – Practice Problems
- Crossed Aldol And Directed Aldol Reactions
- Crossed Aldol Condensation Practice Problems
- Alkylation of Enolates Alpha Position
- Enolate Alkylation Practice Problems
- Acetoacetic Ester Synthesis
- Acetoacetic Ester Enolates Practice Problems
- Malonic Ester Synthesis
- Michael Reaction: The Conjugate Addition of Enolates
- Robinson Annulation, Shortcut, and Retrosynthesis
- Claisen Condensation
- Dieckmann condensation – An Intramolecular Claisen Reaction
- Crossed Claisen and Claisen Variation Reactions
- Claisen Condensation Practice Problems
- Stork Enamine Synthesis
- Enolates in Organic Synthesis – a Comprehensive Practice Problem