There's often an argument over whether the top right or top left is more intuitive, but I've always found that people used to the close button on the top left find that more intuitive, and people used to the close button on the top right find that more intuitive.
Historically the top left option came first with the Apple Lisa (1983), and windows then introduced the top right in an apparent bid to make their system look less like a copy of the Apple interface with Windows 1.0 (1985). I have yet to see anything showing that the choice was made to be more intuitive, although it could very well be.
Apple Lisa Interface, with the close button being the square on the left:

Windows 1 Interfaces with the close button being the corner in the top right:

In short, there is no real "intuitive" option, instead you have to consider what your audience is most used to. Simply based on adoption rates of various operating systems, the top right is likely a better option to go for as it's more prevalent.