The Online Etymology Dictionary says:
1969, "to keep a joint in your mouth," dangling
from the lip like Humphrey Bogart's cigarette in
the old movies, instead of passing it on. First
attested in "Easy Rider." The word was also used
1960s with notions of "get something by
intimidation, be a tough guy" (again with reference to the actor and the characters he
typically played). In old drinking slang, Captain
Cork was "a man slow in passing the bottle."
The Oxford English Dictionary says it is "with allusion to Bogart's frequent on-screen smoking, especially to the long drags he took on cigarettes" and has it from a year earlier:
Popularized by the 1969 U.S. film Easy Rider, the soundtrack of which featured the song cited in quot. 1968.
1968 ‘Fraternity of Man’ Don't bogart Me (transcription of song) in www.stlyrics.com (O.E.D. archive) , Don't bogart that joint, my friend Pass it over to me.
Here's the song's lyrics:
Don't bogart that joint, my friend
Pass it over to me.
Don't bogart that joint, my friend
Pass it over to me.
Roll another one
Just like the other one.
This one's burnt to the end
Come on and be a friend.
Don't bogart that joint, my friend
Pass it over to me.
Don't bogart that joint, my friend
Pass it over to me.
Ro-o-o-o-o-o-o-o-o-o-o-o-o-o-o-oll another one
Just like the other one.
You've been hanging on to it
And I sure would like a hit.
Don't bogart that joint, my friend
Pass it over to me.
Don't bogart that joint, my friend
Pass it over to me