Yes , although anything further than 'stress relief' (relationship-wise) was frowned upon.
An example of someone having (implied) physical relations with a holodeck character is in the Voyager Episode: Human Error .
Seven of Nine, who (in the pursuit of honing her social skills) dates, kisses and then wakes up next to a Holographic version of Chakotay.
Whilst we don't see anything, it is strongly implied that they have relations.
The following is a quote from
The Voyager Transcripts .
Information surrounding the scene has been added in.
SEVEN
: Remain still.
You have an intriguing facial structure. HOLO-CHAKOTAY
: I'll take that as a compliment.
(they kiss) SEVEN:
I require more practice.
HOLO-CHAKOTAY : You're doing just fine.
(Seven hears an electric zizzing sound)
What's wrong?
SEVEN : Nothing. [Cut to Seven's dream] <snip
>
[Cut to Holodeck - Seven's Virtual quarters] (Seven wakes up with the holographic Chakotay draped over her on the couch.
The real Chakotay is hailing her over the com-system)
CHAKOTAY [OC] :
Chakotay to Seven of Nine.
Chakotay to Seven, respond.
SEVEN:
Go ahead.
CHAKOTAY
[OC] :
Report to Astrometrics.
We've found something.
SEVEN :
Yes, Commander.
HOLO-CHAKOTAY :
Good morning.
Another example would be the Vulcans on-board Voyager, having to deal with Pon-far.
Both Tuvok and another Vulcan are shown trying to deal with the symptoms using the holodeck.
It works for Tuvok, but not for the other Vulcan.
Potential Psychological problems/ Unhealthy attachments to holographic characters :
In Star Trek: Voyager, Reginald Barklay (Main contact character of Earth to Voyager) struggled with "Holodeck Addiction" in his past (and suffers a bit of a relapse at one point).
It is a prescribed mental illness, complete with the whole she-bang: drugs, counselling, removal from sources of stress, de-tox etc.
Whilst in Reg's case
it wasn't a relationship in a sexual way to any of the characters, he had re-created virtual embodiments of the entire Voyager crew, and he mentioned that he didn't get a good night's sleep unless he slept in his (virtual) quarters on Voyager.
Some examples are: The Doctor woos a virtual partner (in a 60's style car on an overlook, no less).
Albeit the virtual partner was just a holographic representation of a living being at the time, so she could be considered 'real'
but the doctor isn't- although I don't think anyone would object to him finding a virtual mate.
Harry Kim believes he's fallen for a virtual character (it turns out to be a hoax).
But Tom Paris warns him about holodeck addiction before they figure that out.
Needless to say the holodeck programs are definitely used for this sort of thing - I can see them replacing (or supplementing) real... ahem, 'Ladies of the Night' in a non-military setting.
But anything further than 'stress relief' would be frowned upon, and in extreme cases treated as an illness.
scifi.stackexchange.com/users/11061/Robotnik
Yes.
There were many references to sexual programs available in Quark's holosuites on DS9, featuring slave girls of various species.
Probably the most infamous one (featured in the episode "Meridian") was a custom order from a rich alien named Tiron, who wanted a holosuite program from Quark based on the physical specifications of Major Kira.
scifi.stackexchange.com/users/4096/Kyle Jones
This clip from the TNG episode " The Perfect Mate " depicts Riker heading to the holodeck immediately following a sexually charged encounter.
It is implied that he is headed to the holodeck to resolve the tensions brought about by the encounter - similar to a "cold shower". https://www.youtube.com/watch?v=6lobo3c0NFg
In the TNG episode " Booby Trap ", Geordi develops feelings for a holographic representation of Leah Brahms, one of the engineers who built the Enterprise.
In the later episode " Galaxy's Child ", the real Brahms discovers that Geordi had created a hologram of her and assumes that Geordi used the hologram for sex, though there is no indication that he did so.
The TNG episode " Hollow Pursuits " explores Reginald Barclay's holo-addiction.
Barclay creates a hologram program that includes an embarrassing depiction of Riker as well as sexually-suggestive depictions of Troi and Dr. Crusher.
When Riker discovers the program, he attempts to delete it citing "protocol", but it is not made clear what the exact protocol in question is.
The program could be violating protocol for depicting a senior officer in an unfavorable light or for depicting crew members in overtly sexualized positions.
It is obviously not against protocol to recreate members of the crew on the holodeck, since holographic crews are used during training simulations regularly.
scifi.stackexchange.com/users/11847/Bobwise
To add to the above answers, I believe Riker attempted to re-visit "Minuet" in the episode with the Binars.
The first time he met her, he was with Picard.
He returned without the captain at the end of the episode, only to find her diminished without the Binars extra programming.
And even Geordi created a copy of Leah Brahms.
When discovered by the real Leah Brahms, his reasons are questioned.
scifi.stackexchange.com/users/9309/Jim Green
From the Voyager episode "Fair Haven" , referring to Janeway's holodeck boyfriend Michael Sullivan: Janeway: too bad
he's only photons and force fields.
Chakotay:
I've never let that stop me before.
Translation, "
oh yeah Katherine, I get wild in the holodeck all the time."
scifi.stackexchange.com/users/43882/Katie O'Claire
I think there is a Pon Farr program in Voyager for carnal stress relief.
Seen in Body and soul (for Tuvok) and Blood Fever (for Vorik)
scifi.stackexchange.com/users/29217/user29217
Carnal release is a valid stress relief; and unless the Federation uses hormonal suppressants, it doesn't take a 'perv angle' to realize that the holodecks may be considered for this.  I can also see potential psychological problems with this, as the enhanced 'reality' may create unhealthy attachments.  Some may feel less need for actual human interactions, and social issues may occur.  And of course, the choice of 'programs' may be a problem for some.  There would likely have to be rules.  Or further monitoring.
Have there been any canonical references to the holodeck/holosuites being used for virtual physical 'partnerings' with holodeck-produced constructs?
scifi.stackexchange.com
<star-trek><holodeck><sexuality><psychology>
scifi.stackexchange.com/questions/29207
scifi.stackexchange.com/users/11262/Solemnity
The holodeck programs are definitely used for this sort of thing, although anything further than 'stress relief' was frowned upon. In an attempt to hone her social skills, Seven of Nine dates, kisses and then wakes up next to a Holographic version of Chakotay. Harry Kim believed that he had fallen for a virtual character, Reginald Barklay struggled with "Holodeck Addiction" and the Doctor woos a virtual partner. Holodecks have been known to be used for the purposes of physical intimacy and ‘stress relief’ in various episodes of Star Trek. There is indeed the risk holograms will replace human interactions. 
Holodecks have been known to be used for the purposes of physical intimacy and ‘stress relief’ in various episodes of Star Trek. There is the risk holograms will replace human interactions. 