In the US they are different, but not always used differently depending on the speaking context. Jail is where someone goes when they are first arrested or if they are convicted of a minor crime. Prison is where someone goes when they are convicted of a more serious crime. Going to jail won’t necessarily be on your record, but going to prison would be.
In everyday speech, jail and prison are used kind of interchangeably. I can use jail to mean prison, but it would be sort of weird to use prison to mean jail.