Practical guidance for how to measure for a curtain rod.
Measure beyond the window opening
Allow the rod to extend past the frame so curtains can clear the glass. Check ceiling height, recess depth and any obstructions near the top of the window.
You may also find this guide useful: how to mount shelves and mirrors safely.
You may also find this guide useful: curtain rods and blinds: how to plan the installation.
Practical checks for measure beyond the window opening
Measure window width. Mark the intended rod height. Allow room for brackets and curtains.