Headphone jack stopped working on windows, but it still works in ubuntu

First, ubuntu can't configure your sound card. Hardware devices relies on device drivers. A device driver is a layer between your hardware and the OS kernel. It is different for every device and every kernel.

Second, there can be several reasons behind this. What I am speculating is that windows is unable to load the drivers.

Windows 8.1 comes with the feature of hybrid shutdown. Which basically logs out the user and hybernate the system.

You can try a full shutdown. Run the cmd as admin and type the following command-

shutdown /s /f /t 0

Then start the computer and check if the problem still exists.