Door frames are usually 1-1/2" bigger than the door itself.
Add 1/2" more and that gives you what is called a rough opening. It gives you a little room for shimming the door plumb and level.
So a door slab that measures 36" + the 1-1/2" for the 3/4" jamb on each side+ the 1/2"= 38". And a typical header for that opening would be 41".
So measure the door slab and thats your size. You can never really tell how much extra room you have until you pull off the interior or exterior trim.