Both っぱなし and 〜まま are used to express a constant or continuous action, or an unchanging state or event. Depending on the context, they can sometimes be used interchangeably, but the grammar and nuances required for each are different.
っぱなし (Continuous / Careless State)
This phrase is predominantly spoken; you will not typically see it in highly formal writing. It often carries a negative nuance of carelessness or neglect (e.g., leaving something on that should have been turned off).
【Verb: Stem】っぱなし
テレビを付けっぱなしで寝てしまいました。
I fell asleep with the television on.
エンジンをかけっぱなしにする。
To leave the car running.
電車の網棚にカバンを置きっぱなしにしてしまいました。
I left my bag on the train luggage rack.
ミーティングに遅れて席がなかったので、2時間も立ちっぱなしだったよ。
I was late for the meeting and there were no seats left, so I was standing for 2 hours.
冷房を付けっぱなしにしておく。
Leave the air-conditioning on.
っぱなし is typically used with a relatively limited handful of verbs (such as the ones in the example sentences above).
まま (Unchanged State)
まま describes a neutral, unchanged state and is used freely in both conversation and writing.
【Verb: Simple Past】まま
【Verb: Negative】まま
【Noun】のまま
電気をつけたまま寝る。
Go to sleep with the lights on.
決定を未定のまま、会議が終わりました。
The meeting ended without a decision being made.
うちの子は食べ物を残したまま、遊びに行っちゃうのよ。
Our child just leaves food on his plate and then heads off to play.
相撲は江戸時代から変わらないままである。
Sumo remains unchanged from the Edo period.
そのままの状態。
The status quo.
そのまま受け止める。
Take at face value.
大学に進学しないまま社会人になります。
Enter society without going to university.
So what’s the difference?
Grammatically, the point is whether or not an action is continually required to keep the constant state. For example:
同じシャツを着たままで出勤する。
Go to work in the same shirt.
同じシャツを着っぱなしで出勤する。
Go to work in the same shirt.
Both of the above example sentences use the structures correctly. This is because once you put on a shirt, you do not need to perform any action to keep it on—you only need to put it on once.
This is not always the case. For example, to speak for three hours, you have to continually perform the action of speaking. In cases where such continuous action is required, we cannot use まま.