For acute hospitalized events (MI, stroke, severe infection), one inpatient claim or two outpatient claims within 30 days on different service dates is a common algorithm with good positive predictive value. For chronic conditions, the window can stretch to 365 days.
The window is not a footnote. It changes who is in your cohort, what your incidence rates look like, and whether your comparator arms are even comparable.
Always validate the algorithm in your own data source, and report the exact specification. The repository entry on diagnosis phenotype algorithms covers the 1 IP / 2 OP pattern, the time-window choices, and what each one costs you.