The easiest solution for this might be:
1. Add a Section and within this section place the attachment control.
2. Add formatting so the section is hidden if the checkbox is equal to No.
3. Make sure the default value of the checkbox is set to No.
This means: when the form first opens, the checkbox is unchecked (equal to No) and the section that contains the attachment field is hidden. When the user ticks the checkbox (to make it equal to Yes), the section is shown in the screen.
Hope this helps!